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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) 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 +3448 -394
  10. package/dist/index.cjs.map +1 -1
  11. package/dist/index.d.cts +77 -127
  12. package/dist/index.d.ts +77 -127
  13. package/dist/index.js +3761 -423
  14. package/dist/index.js.map +1 -1
  15. package/dist/logger.cjs +90 -0
  16. package/dist/logger.cjs.map +1 -0
  17. package/dist/logger.d.cts +32 -0
  18. package/dist/logger.d.ts +32 -0
  19. package/dist/logger.js +78 -0
  20. package/dist/logger.js.map +1 -0
  21. package/dist/transformers.cjs +222 -0
  22. package/dist/transformers.cjs.map +1 -0
  23. package/dist/transformers.d.cts +55 -0
  24. package/dist/transformers.d.ts +55 -0
  25. package/dist/transformers.js +207 -0
  26. package/dist/transformers.js.map +1 -0
  27. package/dist/utils.cjs +174 -899
  28. package/dist/utils.cjs.map +1 -1
  29. package/dist/utils.d.cts +2 -146
  30. package/dist/utils.d.ts +2 -146
  31. package/dist/utils.js +175 -859
  32. package/dist/utils.js.map +1 -1
  33. package/dist/write-46ytbnu9.d.cts +7 -0
  34. package/dist/write-46ytbnu9.d.ts +7 -0
  35. package/package.json +27 -12
  36. package/src/BarrelManager.ts +55 -65
  37. package/src/FileManager.ts +109 -68
  38. package/src/PluginManager.ts +55 -32
  39. package/src/build.ts +5 -16
  40. package/src/fs/index.ts +3 -0
  41. package/src/index.ts +4 -5
  42. package/src/{utils/logger.ts → logger.ts} +37 -0
  43. package/src/plugin.ts +4 -4
  44. package/src/transformers/casing.ts +9 -0
  45. package/src/transformers/createJSDocBlockText.ts +9 -0
  46. package/src/transformers/index.ts +36 -0
  47. package/src/transformers/trim.ts +7 -0
  48. package/src/types.ts +23 -42
  49. package/src/utils/FunctionParams.ts +3 -2
  50. package/src/utils/TreeNode.ts +6 -3
  51. package/src/utils/URLPath.ts +5 -5
  52. package/src/utils/index.ts +10 -19
  53. package/src/SchemaGenerator.ts +0 -8
  54. package/src/utils/randomColour.ts +0 -39
  55. package/src/utils/throttle.ts +0 -30
  56. package/src/utils/transformers/createJSDocBlockText.ts +0 -15
  57. package/src/utils/transformers/index.ts +0 -22
  58. package/src/utils/transformers/trim.ts +0 -3
  59. /package/src/{utils → fs}/clean.ts +0 -0
  60. /package/src/{utils → fs}/read.ts +0 -0
  61. /package/src/{utils → fs}/write.ts +0 -0
  62. /package/src/{utils/transformers → transformers}/combineCodes.ts +0 -0
  63. /package/src/{utils/transformers → transformers}/escape.ts +0 -0
  64. /package/src/{utils/transformers → transformers}/indent.ts +0 -0
  65. /package/src/{utils/transformers → transformers}/nameSorter.ts +0 -0
  66. /package/src/{utils/transformers → transformers}/searchAndReplace.ts +0 -0
  67. /package/src/{utils/transformers → transformers}/transformReservedWord.ts +0 -0
package/dist/index.js CHANGED
@@ -1,25 +1,31 @@
1
1
  import mod, { createRequire } from 'module';
2
- import pc3 from 'picocolors';
3
- import fs2, { remove } from 'fs-extra';
4
- import seedrandom from 'seedrandom';
2
+ import pc2 from 'picocolors';
3
+ import path4, { resolve, dirname, extname, relative, basename } from 'path';
5
4
  import { switcher } from 'js-runtime';
6
- import { camelCase, camelCaseTransformMerge } from 'change-case';
5
+ import { camelCase as camelCase$1, camelCaseTransformMerge, pascalCase as pascalCase$1, pascalCaseTransformMerge } from 'change-case';
7
6
  import crypto2 from 'crypto';
8
- import path, { resolve, dirname, extname } from 'path';
9
7
  import { print } from '@kubb/parser';
10
8
  import * as factory from '@kubb/parser/factory';
11
- import isEqual from 'lodash.isequal';
12
9
  import { orderBy } from 'natural-orderby';
13
10
  import dirTree from 'directory-tree';
11
+ import seedrandom from 'seedrandom';
14
12
  import { EventEmitter as EventEmitter$1 } from 'events';
15
13
  import { performance } from 'perf_hooks';
16
14
  import os from 'os';
17
- import { pathToFileURL } from 'url';
18
- import { findUp, findUpSync } from 'find-up';
15
+ import { pathToFileURL, fileURLToPath } from 'url';
16
+ import process2 from 'process';
17
+ import fs3, { promises } from 'fs';
19
18
  import { coerce, satisfies } from 'semver';
20
19
 
21
20
  const require = createRequire(import.meta.url);
22
21
 
22
+ var __create = Object.create;
23
+ var __defProp = Object.defineProperty;
24
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
25
+ var __getOwnPropNames = Object.getOwnPropertyNames;
26
+ var __getProtoOf = Object.getPrototypeOf;
27
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
28
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
23
29
  var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
24
30
  get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
25
31
  }) : x)(function(x) {
@@ -27,6 +33,32 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
27
33
  return require.apply(this, arguments);
28
34
  throw Error('Dynamic require of "' + x + '" is not supported');
29
35
  });
36
+ var __esm = (fn, res) => function __init() {
37
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
38
+ };
39
+ var __commonJS = (cb, mod2) => function __require2() {
40
+ return mod2 || (0, cb[__getOwnPropNames(cb)[0]])((mod2 = { exports: {} }).exports, mod2), mod2.exports;
41
+ };
42
+ var __copyProps = (to, from, except, desc) => {
43
+ if (from && typeof from === "object" || typeof from === "function") {
44
+ for (let key of __getOwnPropNames(from))
45
+ if (!__hasOwnProp.call(to, key) && key !== except)
46
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
47
+ }
48
+ return to;
49
+ };
50
+ var __toESM = (mod2, isNodeMode, target) => (target = mod2 != null ? __create(__getProtoOf(mod2)) : {}, __copyProps(
51
+ // If the importer is in node compatibility mode or this is not an ESM
52
+ // file that has been converted to a CommonJS file using a Babel-
53
+ // compatible transform (i.e. "__esModule" has not been set), then set
54
+ // "default" to the CommonJS "module.exports" for node compatibility.
55
+ isNodeMode || !mod2 || !mod2.__esModule ? __defProp(target, "default", { value: mod2, enumerable: true }) : target,
56
+ mod2
57
+ ));
58
+ var __publicField = (obj, key, value) => {
59
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
60
+ return value;
61
+ };
30
62
  var __accessCheck = (obj, member, msg) => {
31
63
  if (!member.has(obj))
32
64
  throw TypeError("Cannot " + msg);
@@ -57,84 +89,2960 @@ var __privateMethod = (obj, member, method) => {
57
89
  __accessCheck(obj, member, "access private method");
58
90
  return method;
59
91
  };
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);
92
+
93
+ // ../../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
94
+ var init_esm_shims = __esm({
95
+ "../../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"() {
96
+ }
97
+ });
98
+
99
+ // ../../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js
100
+ var require_universalify = __commonJS({
101
+ "../../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js"(exports) {
102
+ init_esm_shims();
103
+ exports.fromCallback = function(fn) {
104
+ return Object.defineProperty(function(...args) {
105
+ if (typeof args[args.length - 1] === "function")
106
+ fn.apply(this, args);
107
+ else {
108
+ return new Promise((resolve3, reject) => {
109
+ args.push((err, res) => err != null ? reject(err) : resolve3(res));
110
+ fn.apply(this, args);
111
+ });
112
+ }
113
+ }, "name", { value: fn.name });
114
+ };
115
+ exports.fromPromise = function(fn) {
116
+ return Object.defineProperty(function(...args) {
117
+ const cb = args[args.length - 1];
118
+ if (typeof cb !== "function")
119
+ return fn.apply(this, args);
120
+ else {
121
+ args.pop();
122
+ fn.apply(this, args).then((r) => cb(null, r), cb);
123
+ }
124
+ }, "name", { value: fn.name });
125
+ };
126
+ }
127
+ });
128
+
129
+ // ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js
130
+ var require_polyfills = __commonJS({
131
+ "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js"(exports, module) {
132
+ init_esm_shims();
133
+ var constants = __require("constants");
134
+ var origCwd = process.cwd;
135
+ var cwd = null;
136
+ var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform;
137
+ process.cwd = function() {
138
+ if (!cwd)
139
+ cwd = origCwd.call(process);
140
+ return cwd;
141
+ };
142
+ try {
143
+ process.cwd();
144
+ } catch (er) {
74
145
  }
75
- };
76
- const error = (message) => {
77
- if (message) {
78
- throw new Error(message || "Something went wrong");
146
+ if (typeof process.chdir === "function") {
147
+ chdir = process.chdir;
148
+ process.chdir = function(d) {
149
+ cwd = null;
150
+ chdir.call(process, d);
151
+ };
152
+ if (Object.setPrototypeOf)
153
+ Object.setPrototypeOf(process.chdir, chdir);
154
+ }
155
+ var chdir;
156
+ module.exports = patch;
157
+ function patch(fs4) {
158
+ if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
159
+ patchLchmod(fs4);
160
+ }
161
+ if (!fs4.lutimes) {
162
+ patchLutimes(fs4);
163
+ }
164
+ fs4.chown = chownFix(fs4.chown);
165
+ fs4.fchown = chownFix(fs4.fchown);
166
+ fs4.lchown = chownFix(fs4.lchown);
167
+ fs4.chmod = chmodFix(fs4.chmod);
168
+ fs4.fchmod = chmodFix(fs4.fchmod);
169
+ fs4.lchmod = chmodFix(fs4.lchmod);
170
+ fs4.chownSync = chownFixSync(fs4.chownSync);
171
+ fs4.fchownSync = chownFixSync(fs4.fchownSync);
172
+ fs4.lchownSync = chownFixSync(fs4.lchownSync);
173
+ fs4.chmodSync = chmodFixSync(fs4.chmodSync);
174
+ fs4.fchmodSync = chmodFixSync(fs4.fchmodSync);
175
+ fs4.lchmodSync = chmodFixSync(fs4.lchmodSync);
176
+ fs4.stat = statFix(fs4.stat);
177
+ fs4.fstat = statFix(fs4.fstat);
178
+ fs4.lstat = statFix(fs4.lstat);
179
+ fs4.statSync = statFixSync(fs4.statSync);
180
+ fs4.fstatSync = statFixSync(fs4.fstatSync);
181
+ fs4.lstatSync = statFixSync(fs4.lstatSync);
182
+ if (fs4.chmod && !fs4.lchmod) {
183
+ fs4.lchmod = function(path5, mode, cb) {
184
+ if (cb)
185
+ process.nextTick(cb);
186
+ };
187
+ fs4.lchmodSync = function() {
188
+ };
189
+ }
190
+ if (fs4.chown && !fs4.lchown) {
191
+ fs4.lchown = function(path5, uid, gid, cb) {
192
+ if (cb)
193
+ process.nextTick(cb);
194
+ };
195
+ fs4.lchownSync = function() {
196
+ };
197
+ }
198
+ if (platform === "win32") {
199
+ fs4.rename = typeof fs4.rename !== "function" ? fs4.rename : function(fs$rename) {
200
+ function rename(from, to, cb) {
201
+ var start = Date.now();
202
+ var backoff = 0;
203
+ fs$rename(from, to, function CB(er) {
204
+ if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
205
+ setTimeout(function() {
206
+ fs4.stat(to, function(stater, st) {
207
+ if (stater && stater.code === "ENOENT")
208
+ fs$rename(from, to, CB);
209
+ else
210
+ cb(er);
211
+ });
212
+ }, backoff);
213
+ if (backoff < 100)
214
+ backoff += 10;
215
+ return;
216
+ }
217
+ if (cb)
218
+ cb(er);
219
+ });
220
+ }
221
+ if (Object.setPrototypeOf)
222
+ Object.setPrototypeOf(rename, fs$rename);
223
+ return rename;
224
+ }(fs4.rename);
225
+ }
226
+ fs4.read = typeof fs4.read !== "function" ? fs4.read : function(fs$read) {
227
+ function read2(fd, buffer, offset, length, position, callback_) {
228
+ var callback;
229
+ if (callback_ && typeof callback_ === "function") {
230
+ var eagCounter = 0;
231
+ callback = function(er, _, __) {
232
+ if (er && er.code === "EAGAIN" && eagCounter < 10) {
233
+ eagCounter++;
234
+ return fs$read.call(fs4, fd, buffer, offset, length, position, callback);
235
+ }
236
+ callback_.apply(this, arguments);
237
+ };
238
+ }
239
+ return fs$read.call(fs4, fd, buffer, offset, length, position, callback);
240
+ }
241
+ if (Object.setPrototypeOf)
242
+ Object.setPrototypeOf(read2, fs$read);
243
+ return read2;
244
+ }(fs4.read);
245
+ fs4.readSync = typeof fs4.readSync !== "function" ? fs4.readSync : /* @__PURE__ */ function(fs$readSync) {
246
+ return function(fd, buffer, offset, length, position) {
247
+ var eagCounter = 0;
248
+ while (true) {
249
+ try {
250
+ return fs$readSync.call(fs4, fd, buffer, offset, length, position);
251
+ } catch (er) {
252
+ if (er.code === "EAGAIN" && eagCounter < 10) {
253
+ eagCounter++;
254
+ continue;
255
+ }
256
+ throw er;
257
+ }
258
+ }
259
+ };
260
+ }(fs4.readSync);
261
+ function patchLchmod(fs5) {
262
+ fs5.lchmod = function(path5, mode, callback) {
263
+ fs5.open(
264
+ path5,
265
+ constants.O_WRONLY | constants.O_SYMLINK,
266
+ mode,
267
+ function(err, fd) {
268
+ if (err) {
269
+ if (callback)
270
+ callback(err);
271
+ return;
272
+ }
273
+ fs5.fchmod(fd, mode, function(err2) {
274
+ fs5.close(fd, function(err22) {
275
+ if (callback)
276
+ callback(err2 || err22);
277
+ });
278
+ });
279
+ }
280
+ );
281
+ };
282
+ fs5.lchmodSync = function(path5, mode) {
283
+ var fd = fs5.openSync(path5, constants.O_WRONLY | constants.O_SYMLINK, mode);
284
+ var threw = true;
285
+ var ret;
286
+ try {
287
+ ret = fs5.fchmodSync(fd, mode);
288
+ threw = false;
289
+ } finally {
290
+ if (threw) {
291
+ try {
292
+ fs5.closeSync(fd);
293
+ } catch (er) {
294
+ }
295
+ } else {
296
+ fs5.closeSync(fd);
297
+ }
298
+ }
299
+ return ret;
300
+ };
301
+ }
302
+ function patchLutimes(fs5) {
303
+ if (constants.hasOwnProperty("O_SYMLINK") && fs5.futimes) {
304
+ fs5.lutimes = function(path5, at, mt, cb) {
305
+ fs5.open(path5, constants.O_SYMLINK, function(er, fd) {
306
+ if (er) {
307
+ if (cb)
308
+ cb(er);
309
+ return;
310
+ }
311
+ fs5.futimes(fd, at, mt, function(er2) {
312
+ fs5.close(fd, function(er22) {
313
+ if (cb)
314
+ cb(er2 || er22);
315
+ });
316
+ });
317
+ });
318
+ };
319
+ fs5.lutimesSync = function(path5, at, mt) {
320
+ var fd = fs5.openSync(path5, constants.O_SYMLINK);
321
+ var ret;
322
+ var threw = true;
323
+ try {
324
+ ret = fs5.futimesSync(fd, at, mt);
325
+ threw = false;
326
+ } finally {
327
+ if (threw) {
328
+ try {
329
+ fs5.closeSync(fd);
330
+ } catch (er) {
331
+ }
332
+ } else {
333
+ fs5.closeSync(fd);
334
+ }
335
+ }
336
+ return ret;
337
+ };
338
+ } else if (fs5.futimes) {
339
+ fs5.lutimes = function(_a, _b, _c, cb) {
340
+ if (cb)
341
+ process.nextTick(cb);
342
+ };
343
+ fs5.lutimesSync = function() {
344
+ };
345
+ }
346
+ }
347
+ function chmodFix(orig) {
348
+ if (!orig)
349
+ return orig;
350
+ return function(target, mode, cb) {
351
+ return orig.call(fs4, target, mode, function(er) {
352
+ if (chownErOk(er))
353
+ er = null;
354
+ if (cb)
355
+ cb.apply(this, arguments);
356
+ });
357
+ };
358
+ }
359
+ function chmodFixSync(orig) {
360
+ if (!orig)
361
+ return orig;
362
+ return function(target, mode) {
363
+ try {
364
+ return orig.call(fs4, target, mode);
365
+ } catch (er) {
366
+ if (!chownErOk(er))
367
+ throw er;
368
+ }
369
+ };
370
+ }
371
+ function chownFix(orig) {
372
+ if (!orig)
373
+ return orig;
374
+ return function(target, uid, gid, cb) {
375
+ return orig.call(fs4, target, uid, gid, function(er) {
376
+ if (chownErOk(er))
377
+ er = null;
378
+ if (cb)
379
+ cb.apply(this, arguments);
380
+ });
381
+ };
382
+ }
383
+ function chownFixSync(orig) {
384
+ if (!orig)
385
+ return orig;
386
+ return function(target, uid, gid) {
387
+ try {
388
+ return orig.call(fs4, target, uid, gid);
389
+ } catch (er) {
390
+ if (!chownErOk(er))
391
+ throw er;
392
+ }
393
+ };
394
+ }
395
+ function statFix(orig) {
396
+ if (!orig)
397
+ return orig;
398
+ return function(target, options, cb) {
399
+ if (typeof options === "function") {
400
+ cb = options;
401
+ options = null;
402
+ }
403
+ function callback(er, stats) {
404
+ if (stats) {
405
+ if (stats.uid < 0)
406
+ stats.uid += 4294967296;
407
+ if (stats.gid < 0)
408
+ stats.gid += 4294967296;
409
+ }
410
+ if (cb)
411
+ cb.apply(this, arguments);
412
+ }
413
+ return options ? orig.call(fs4, target, options, callback) : orig.call(fs4, target, callback);
414
+ };
415
+ }
416
+ function statFixSync(orig) {
417
+ if (!orig)
418
+ return orig;
419
+ return function(target, options) {
420
+ var stats = options ? orig.call(fs4, target, options) : orig.call(fs4, target);
421
+ if (stats) {
422
+ if (stats.uid < 0)
423
+ stats.uid += 4294967296;
424
+ if (stats.gid < 0)
425
+ stats.gid += 4294967296;
426
+ }
427
+ return stats;
428
+ };
429
+ }
430
+ function chownErOk(er) {
431
+ if (!er)
432
+ return true;
433
+ if (er.code === "ENOSYS")
434
+ return true;
435
+ var nonroot = !process.getuid || process.getuid() !== 0;
436
+ if (nonroot) {
437
+ if (er.code === "EINVAL" || er.code === "EPERM")
438
+ return true;
439
+ }
440
+ return false;
441
+ }
442
+ }
443
+ }
444
+ });
445
+
446
+ // ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js
447
+ var require_legacy_streams = __commonJS({
448
+ "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js"(exports, module) {
449
+ init_esm_shims();
450
+ var Stream = __require("stream").Stream;
451
+ module.exports = legacy;
452
+ function legacy(fs4) {
453
+ return {
454
+ ReadStream,
455
+ WriteStream
456
+ };
457
+ function ReadStream(path5, options) {
458
+ if (!(this instanceof ReadStream))
459
+ return new ReadStream(path5, options);
460
+ Stream.call(this);
461
+ var self2 = this;
462
+ this.path = path5;
463
+ this.fd = null;
464
+ this.readable = true;
465
+ this.paused = false;
466
+ this.flags = "r";
467
+ this.mode = 438;
468
+ this.bufferSize = 64 * 1024;
469
+ options = options || {};
470
+ var keys = Object.keys(options);
471
+ for (var index = 0, length = keys.length; index < length; index++) {
472
+ var key = keys[index];
473
+ this[key] = options[key];
474
+ }
475
+ if (this.encoding)
476
+ this.setEncoding(this.encoding);
477
+ if (this.start !== void 0) {
478
+ if ("number" !== typeof this.start) {
479
+ throw TypeError("start must be a Number");
480
+ }
481
+ if (this.end === void 0) {
482
+ this.end = Infinity;
483
+ } else if ("number" !== typeof this.end) {
484
+ throw TypeError("end must be a Number");
485
+ }
486
+ if (this.start > this.end) {
487
+ throw new Error("start must be <= end");
488
+ }
489
+ this.pos = this.start;
490
+ }
491
+ if (this.fd !== null) {
492
+ process.nextTick(function() {
493
+ self2._read();
494
+ });
495
+ return;
496
+ }
497
+ fs4.open(this.path, this.flags, this.mode, function(err, fd) {
498
+ if (err) {
499
+ self2.emit("error", err);
500
+ self2.readable = false;
501
+ return;
502
+ }
503
+ self2.fd = fd;
504
+ self2.emit("open", fd);
505
+ self2._read();
506
+ });
507
+ }
508
+ function WriteStream(path5, options) {
509
+ if (!(this instanceof WriteStream))
510
+ return new WriteStream(path5, options);
511
+ Stream.call(this);
512
+ this.path = path5;
513
+ this.fd = null;
514
+ this.writable = true;
515
+ this.flags = "w";
516
+ this.encoding = "binary";
517
+ this.mode = 438;
518
+ this.bytesWritten = 0;
519
+ options = options || {};
520
+ var keys = Object.keys(options);
521
+ for (var index = 0, length = keys.length; index < length; index++) {
522
+ var key = keys[index];
523
+ this[key] = options[key];
524
+ }
525
+ if (this.start !== void 0) {
526
+ if ("number" !== typeof this.start) {
527
+ throw TypeError("start must be a Number");
528
+ }
529
+ if (this.start < 0) {
530
+ throw new Error("start must be >= zero");
531
+ }
532
+ this.pos = this.start;
533
+ }
534
+ this.busy = false;
535
+ this._queue = [];
536
+ if (this.fd === null) {
537
+ this._open = fs4.open;
538
+ this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
539
+ this.flush();
540
+ }
541
+ }
542
+ }
543
+ }
544
+ });
545
+
546
+ // ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/clone.js
547
+ var require_clone = __commonJS({
548
+ "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/clone.js"(exports, module) {
549
+ init_esm_shims();
550
+ module.exports = clone;
551
+ var getPrototypeOf = Object.getPrototypeOf || function(obj) {
552
+ return obj.__proto__;
553
+ };
554
+ function clone(obj) {
555
+ if (obj === null || typeof obj !== "object")
556
+ return obj;
557
+ if (obj instanceof Object)
558
+ var copy = { __proto__: getPrototypeOf(obj) };
559
+ else
560
+ var copy = /* @__PURE__ */ Object.create(null);
561
+ Object.getOwnPropertyNames(obj).forEach(function(key) {
562
+ Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key));
563
+ });
564
+ return copy;
565
+ }
566
+ }
567
+ });
568
+
569
+ // ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js
570
+ var require_graceful_fs = __commonJS({
571
+ "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js"(exports, module) {
572
+ init_esm_shims();
573
+ var fs4 = __require("fs");
574
+ var polyfills = require_polyfills();
575
+ var legacy = require_legacy_streams();
576
+ var clone = require_clone();
577
+ var util = __require("util");
578
+ var gracefulQueue;
579
+ var previousSymbol;
580
+ if (typeof Symbol === "function" && typeof Symbol.for === "function") {
581
+ gracefulQueue = Symbol.for("graceful-fs.queue");
582
+ previousSymbol = Symbol.for("graceful-fs.previous");
583
+ } else {
584
+ gracefulQueue = "___graceful-fs.queue";
585
+ previousSymbol = "___graceful-fs.previous";
586
+ }
587
+ function noop() {
588
+ }
589
+ function publishQueue(context, queue2) {
590
+ Object.defineProperty(context, gracefulQueue, {
591
+ get: function() {
592
+ return queue2;
593
+ }
594
+ });
595
+ }
596
+ var debug = noop;
597
+ if (util.debuglog)
598
+ debug = util.debuglog("gfs4");
599
+ else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ""))
600
+ debug = function() {
601
+ var m = util.format.apply(util, arguments);
602
+ m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
603
+ console.error(m);
604
+ };
605
+ if (!fs4[gracefulQueue]) {
606
+ queue = global[gracefulQueue] || [];
607
+ publishQueue(fs4, queue);
608
+ fs4.close = function(fs$close) {
609
+ function close(fd, cb) {
610
+ return fs$close.call(fs4, fd, function(err) {
611
+ if (!err) {
612
+ resetQueue();
613
+ }
614
+ if (typeof cb === "function")
615
+ cb.apply(this, arguments);
616
+ });
617
+ }
618
+ Object.defineProperty(close, previousSymbol, {
619
+ value: fs$close
620
+ });
621
+ return close;
622
+ }(fs4.close);
623
+ fs4.closeSync = function(fs$closeSync) {
624
+ function closeSync(fd) {
625
+ fs$closeSync.apply(fs4, arguments);
626
+ resetQueue();
627
+ }
628
+ Object.defineProperty(closeSync, previousSymbol, {
629
+ value: fs$closeSync
630
+ });
631
+ return closeSync;
632
+ }(fs4.closeSync);
633
+ if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
634
+ process.on("exit", function() {
635
+ debug(fs4[gracefulQueue]);
636
+ __require("assert").equal(fs4[gracefulQueue].length, 0);
637
+ });
638
+ }
639
+ }
640
+ var queue;
641
+ if (!global[gracefulQueue]) {
642
+ publishQueue(global, fs4[gracefulQueue]);
643
+ }
644
+ module.exports = patch(clone(fs4));
645
+ if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs4.__patched) {
646
+ module.exports = patch(fs4);
647
+ fs4.__patched = true;
648
+ }
649
+ function patch(fs5) {
650
+ polyfills(fs5);
651
+ fs5.gracefulify = patch;
652
+ fs5.createReadStream = createReadStream;
653
+ fs5.createWriteStream = createWriteStream;
654
+ var fs$readFile = fs5.readFile;
655
+ fs5.readFile = readFile;
656
+ function readFile(path5, options, cb) {
657
+ if (typeof options === "function")
658
+ cb = options, options = null;
659
+ return go$readFile(path5, options, cb);
660
+ function go$readFile(path6, options2, cb2, startTime) {
661
+ return fs$readFile(path6, options2, function(err) {
662
+ if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
663
+ enqueue([go$readFile, [path6, options2, cb2], err, startTime || Date.now(), Date.now()]);
664
+ else {
665
+ if (typeof cb2 === "function")
666
+ cb2.apply(this, arguments);
667
+ }
668
+ });
669
+ }
670
+ }
671
+ var fs$writeFile = fs5.writeFile;
672
+ fs5.writeFile = writeFile;
673
+ function writeFile(path5, data, options, cb) {
674
+ if (typeof options === "function")
675
+ cb = options, options = null;
676
+ return go$writeFile(path5, data, options, cb);
677
+ function go$writeFile(path6, data2, options2, cb2, startTime) {
678
+ return fs$writeFile(path6, data2, options2, function(err) {
679
+ if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
680
+ enqueue([go$writeFile, [path6, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
681
+ else {
682
+ if (typeof cb2 === "function")
683
+ cb2.apply(this, arguments);
684
+ }
685
+ });
686
+ }
687
+ }
688
+ var fs$appendFile = fs5.appendFile;
689
+ if (fs$appendFile)
690
+ fs5.appendFile = appendFile;
691
+ function appendFile(path5, data, options, cb) {
692
+ if (typeof options === "function")
693
+ cb = options, options = null;
694
+ return go$appendFile(path5, data, options, cb);
695
+ function go$appendFile(path6, data2, options2, cb2, startTime) {
696
+ return fs$appendFile(path6, data2, options2, function(err) {
697
+ if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
698
+ enqueue([go$appendFile, [path6, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
699
+ else {
700
+ if (typeof cb2 === "function")
701
+ cb2.apply(this, arguments);
702
+ }
703
+ });
704
+ }
705
+ }
706
+ var fs$copyFile = fs5.copyFile;
707
+ if (fs$copyFile)
708
+ fs5.copyFile = copyFile;
709
+ function copyFile(src, dest, flags, cb) {
710
+ if (typeof flags === "function") {
711
+ cb = flags;
712
+ flags = 0;
713
+ }
714
+ return go$copyFile(src, dest, flags, cb);
715
+ function go$copyFile(src2, dest2, flags2, cb2, startTime) {
716
+ return fs$copyFile(src2, dest2, flags2, function(err) {
717
+ if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
718
+ enqueue([go$copyFile, [src2, dest2, flags2, cb2], err, startTime || Date.now(), Date.now()]);
719
+ else {
720
+ if (typeof cb2 === "function")
721
+ cb2.apply(this, arguments);
722
+ }
723
+ });
724
+ }
725
+ }
726
+ var fs$readdir = fs5.readdir;
727
+ fs5.readdir = readdir;
728
+ var noReaddirOptionVersions = /^v[0-5]\./;
729
+ function readdir(path5, options, cb) {
730
+ if (typeof options === "function")
731
+ cb = options, options = null;
732
+ var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path6, options2, cb2, startTime) {
733
+ return fs$readdir(path6, fs$readdirCallback(
734
+ path6,
735
+ options2,
736
+ cb2,
737
+ startTime
738
+ ));
739
+ } : function go$readdir2(path6, options2, cb2, startTime) {
740
+ return fs$readdir(path6, options2, fs$readdirCallback(
741
+ path6,
742
+ options2,
743
+ cb2,
744
+ startTime
745
+ ));
746
+ };
747
+ return go$readdir(path5, options, cb);
748
+ function fs$readdirCallback(path6, options2, cb2, startTime) {
749
+ return function(err, files) {
750
+ if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
751
+ enqueue([
752
+ go$readdir,
753
+ [path6, options2, cb2],
754
+ err,
755
+ startTime || Date.now(),
756
+ Date.now()
757
+ ]);
758
+ else {
759
+ if (files && files.sort)
760
+ files.sort();
761
+ if (typeof cb2 === "function")
762
+ cb2.call(this, err, files);
763
+ }
764
+ };
765
+ }
766
+ }
767
+ if (process.version.substr(0, 4) === "v0.8") {
768
+ var legStreams = legacy(fs5);
769
+ ReadStream = legStreams.ReadStream;
770
+ WriteStream = legStreams.WriteStream;
771
+ }
772
+ var fs$ReadStream = fs5.ReadStream;
773
+ if (fs$ReadStream) {
774
+ ReadStream.prototype = Object.create(fs$ReadStream.prototype);
775
+ ReadStream.prototype.open = ReadStream$open;
776
+ }
777
+ var fs$WriteStream = fs5.WriteStream;
778
+ if (fs$WriteStream) {
779
+ WriteStream.prototype = Object.create(fs$WriteStream.prototype);
780
+ WriteStream.prototype.open = WriteStream$open;
781
+ }
782
+ Object.defineProperty(fs5, "ReadStream", {
783
+ get: function() {
784
+ return ReadStream;
785
+ },
786
+ set: function(val) {
787
+ ReadStream = val;
788
+ },
789
+ enumerable: true,
790
+ configurable: true
791
+ });
792
+ Object.defineProperty(fs5, "WriteStream", {
793
+ get: function() {
794
+ return WriteStream;
795
+ },
796
+ set: function(val) {
797
+ WriteStream = val;
798
+ },
799
+ enumerable: true,
800
+ configurable: true
801
+ });
802
+ var FileReadStream = ReadStream;
803
+ Object.defineProperty(fs5, "FileReadStream", {
804
+ get: function() {
805
+ return FileReadStream;
806
+ },
807
+ set: function(val) {
808
+ FileReadStream = val;
809
+ },
810
+ enumerable: true,
811
+ configurable: true
812
+ });
813
+ var FileWriteStream = WriteStream;
814
+ Object.defineProperty(fs5, "FileWriteStream", {
815
+ get: function() {
816
+ return FileWriteStream;
817
+ },
818
+ set: function(val) {
819
+ FileWriteStream = val;
820
+ },
821
+ enumerable: true,
822
+ configurable: true
823
+ });
824
+ function ReadStream(path5, options) {
825
+ if (this instanceof ReadStream)
826
+ return fs$ReadStream.apply(this, arguments), this;
827
+ else
828
+ return ReadStream.apply(Object.create(ReadStream.prototype), arguments);
829
+ }
830
+ function ReadStream$open() {
831
+ var that = this;
832
+ open(that.path, that.flags, that.mode, function(err, fd) {
833
+ if (err) {
834
+ if (that.autoClose)
835
+ that.destroy();
836
+ that.emit("error", err);
837
+ } else {
838
+ that.fd = fd;
839
+ that.emit("open", fd);
840
+ that.read();
841
+ }
842
+ });
843
+ }
844
+ function WriteStream(path5, options) {
845
+ if (this instanceof WriteStream)
846
+ return fs$WriteStream.apply(this, arguments), this;
847
+ else
848
+ return WriteStream.apply(Object.create(WriteStream.prototype), arguments);
849
+ }
850
+ function WriteStream$open() {
851
+ var that = this;
852
+ open(that.path, that.flags, that.mode, function(err, fd) {
853
+ if (err) {
854
+ that.destroy();
855
+ that.emit("error", err);
856
+ } else {
857
+ that.fd = fd;
858
+ that.emit("open", fd);
859
+ }
860
+ });
861
+ }
862
+ function createReadStream(path5, options) {
863
+ return new fs5.ReadStream(path5, options);
864
+ }
865
+ function createWriteStream(path5, options) {
866
+ return new fs5.WriteStream(path5, options);
867
+ }
868
+ var fs$open = fs5.open;
869
+ fs5.open = open;
870
+ function open(path5, flags, mode, cb) {
871
+ if (typeof mode === "function")
872
+ cb = mode, mode = null;
873
+ return go$open(path5, flags, mode, cb);
874
+ function go$open(path6, flags2, mode2, cb2, startTime) {
875
+ return fs$open(path6, flags2, mode2, function(err, fd) {
876
+ if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
877
+ enqueue([go$open, [path6, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
878
+ else {
879
+ if (typeof cb2 === "function")
880
+ cb2.apply(this, arguments);
881
+ }
882
+ });
883
+ }
884
+ }
885
+ return fs5;
886
+ }
887
+ function enqueue(elem) {
888
+ debug("ENQUEUE", elem[0].name, elem[1]);
889
+ fs4[gracefulQueue].push(elem);
890
+ retry();
891
+ }
892
+ var retryTimer;
893
+ function resetQueue() {
894
+ var now = Date.now();
895
+ for (var i = 0; i < fs4[gracefulQueue].length; ++i) {
896
+ if (fs4[gracefulQueue][i].length > 2) {
897
+ fs4[gracefulQueue][i][3] = now;
898
+ fs4[gracefulQueue][i][4] = now;
899
+ }
900
+ }
901
+ retry();
902
+ }
903
+ function retry() {
904
+ clearTimeout(retryTimer);
905
+ retryTimer = void 0;
906
+ if (fs4[gracefulQueue].length === 0)
907
+ return;
908
+ var elem = fs4[gracefulQueue].shift();
909
+ var fn = elem[0];
910
+ var args = elem[1];
911
+ var err = elem[2];
912
+ var startTime = elem[3];
913
+ var lastTime = elem[4];
914
+ if (startTime === void 0) {
915
+ debug("RETRY", fn.name, args);
916
+ fn.apply(null, args);
917
+ } else if (Date.now() - startTime >= 6e4) {
918
+ debug("TIMEOUT", fn.name, args);
919
+ var cb = args.pop();
920
+ if (typeof cb === "function")
921
+ cb.call(null, err);
922
+ } else {
923
+ var sinceAttempt = Date.now() - lastTime;
924
+ var sinceStart = Math.max(lastTime - startTime, 1);
925
+ var desiredDelay = Math.min(sinceStart * 1.2, 100);
926
+ if (sinceAttempt >= desiredDelay) {
927
+ debug("RETRY", fn.name, args);
928
+ fn.apply(null, args.concat([startTime]));
929
+ } else {
930
+ fs4[gracefulQueue].push(elem);
931
+ }
932
+ }
933
+ if (retryTimer === void 0) {
934
+ retryTimer = setTimeout(retry, 0);
935
+ }
936
+ }
937
+ }
938
+ });
939
+
940
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/fs/index.js
941
+ var require_fs = __commonJS({
942
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/fs/index.js"(exports) {
943
+ init_esm_shims();
944
+ var u = require_universalify().fromCallback;
945
+ var fs4 = require_graceful_fs();
946
+ var api = [
947
+ "access",
948
+ "appendFile",
949
+ "chmod",
950
+ "chown",
951
+ "close",
952
+ "copyFile",
953
+ "fchmod",
954
+ "fchown",
955
+ "fdatasync",
956
+ "fstat",
957
+ "fsync",
958
+ "ftruncate",
959
+ "futimes",
960
+ "lchmod",
961
+ "lchown",
962
+ "link",
963
+ "lstat",
964
+ "mkdir",
965
+ "mkdtemp",
966
+ "open",
967
+ "opendir",
968
+ "readdir",
969
+ "readFile",
970
+ "readlink",
971
+ "realpath",
972
+ "rename",
973
+ "rm",
974
+ "rmdir",
975
+ "stat",
976
+ "symlink",
977
+ "truncate",
978
+ "unlink",
979
+ "utimes",
980
+ "writeFile"
981
+ ].filter((key) => {
982
+ return typeof fs4[key] === "function";
983
+ });
984
+ Object.assign(exports, fs4);
985
+ api.forEach((method) => {
986
+ exports[method] = u(fs4[method]);
987
+ });
988
+ exports.exists = function(filename, callback) {
989
+ if (typeof callback === "function") {
990
+ return fs4.exists(filename, callback);
991
+ }
992
+ return new Promise((resolve3) => {
993
+ return fs4.exists(filename, resolve3);
994
+ });
995
+ };
996
+ exports.read = function(fd, buffer, offset, length, position, callback) {
997
+ if (typeof callback === "function") {
998
+ return fs4.read(fd, buffer, offset, length, position, callback);
999
+ }
1000
+ return new Promise((resolve3, reject) => {
1001
+ fs4.read(fd, buffer, offset, length, position, (err, bytesRead, buffer2) => {
1002
+ if (err)
1003
+ return reject(err);
1004
+ resolve3({ bytesRead, buffer: buffer2 });
1005
+ });
1006
+ });
1007
+ };
1008
+ exports.write = function(fd, buffer, ...args) {
1009
+ if (typeof args[args.length - 1] === "function") {
1010
+ return fs4.write(fd, buffer, ...args);
1011
+ }
1012
+ return new Promise((resolve3, reject) => {
1013
+ fs4.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => {
1014
+ if (err)
1015
+ return reject(err);
1016
+ resolve3({ bytesWritten, buffer: buffer2 });
1017
+ });
1018
+ });
1019
+ };
1020
+ exports.readv = function(fd, buffers, ...args) {
1021
+ if (typeof args[args.length - 1] === "function") {
1022
+ return fs4.readv(fd, buffers, ...args);
1023
+ }
1024
+ return new Promise((resolve3, reject) => {
1025
+ fs4.readv(fd, buffers, ...args, (err, bytesRead, buffers2) => {
1026
+ if (err)
1027
+ return reject(err);
1028
+ resolve3({ bytesRead, buffers: buffers2 });
1029
+ });
1030
+ });
1031
+ };
1032
+ exports.writev = function(fd, buffers, ...args) {
1033
+ if (typeof args[args.length - 1] === "function") {
1034
+ return fs4.writev(fd, buffers, ...args);
1035
+ }
1036
+ return new Promise((resolve3, reject) => {
1037
+ fs4.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => {
1038
+ if (err)
1039
+ return reject(err);
1040
+ resolve3({ bytesWritten, buffers: buffers2 });
1041
+ });
1042
+ });
1043
+ };
1044
+ if (typeof fs4.realpath.native === "function") {
1045
+ exports.realpath.native = u(fs4.realpath.native);
1046
+ } else {
1047
+ process.emitWarning(
1048
+ "fs.realpath.native is not a function. Is fs being monkey-patched?",
1049
+ "Warning",
1050
+ "fs-extra-WARN0003"
1051
+ );
1052
+ }
1053
+ }
1054
+ });
1055
+
1056
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/utils.js
1057
+ var require_utils = __commonJS({
1058
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/utils.js"(exports, module) {
1059
+ init_esm_shims();
1060
+ var path5 = __require("path");
1061
+ module.exports.checkPath = function checkPath(pth) {
1062
+ if (process.platform === "win32") {
1063
+ const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path5.parse(pth).root, ""));
1064
+ if (pathHasInvalidWinCharacters) {
1065
+ const error = new Error(`Path contains invalid characters: ${pth}`);
1066
+ error.code = "EINVAL";
1067
+ throw error;
1068
+ }
1069
+ }
1070
+ };
1071
+ }
1072
+ });
1073
+
1074
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/make-dir.js
1075
+ var require_make_dir = __commonJS({
1076
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports, module) {
1077
+ init_esm_shims();
1078
+ var fs4 = require_fs();
1079
+ var { checkPath } = require_utils();
1080
+ var getMode = (options) => {
1081
+ const defaults = { mode: 511 };
1082
+ if (typeof options === "number")
1083
+ return options;
1084
+ return { ...defaults, ...options }.mode;
1085
+ };
1086
+ module.exports.makeDir = async (dir, options) => {
1087
+ checkPath(dir);
1088
+ return fs4.mkdir(dir, {
1089
+ mode: getMode(options),
1090
+ recursive: true
1091
+ });
1092
+ };
1093
+ module.exports.makeDirSync = (dir, options) => {
1094
+ checkPath(dir);
1095
+ return fs4.mkdirSync(dir, {
1096
+ mode: getMode(options),
1097
+ recursive: true
1098
+ });
1099
+ };
1100
+ }
1101
+ });
1102
+
1103
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/index.js
1104
+ var require_mkdirs = __commonJS({
1105
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/index.js"(exports, module) {
1106
+ init_esm_shims();
1107
+ var u = require_universalify().fromPromise;
1108
+ var { makeDir: _makeDir, makeDirSync } = require_make_dir();
1109
+ var makeDir = u(_makeDir);
1110
+ module.exports = {
1111
+ mkdirs: makeDir,
1112
+ mkdirsSync: makeDirSync,
1113
+ // alias
1114
+ mkdirp: makeDir,
1115
+ mkdirpSync: makeDirSync,
1116
+ ensureDir: makeDir,
1117
+ ensureDirSync: makeDirSync
1118
+ };
1119
+ }
1120
+ });
1121
+
1122
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/path-exists/index.js
1123
+ var require_path_exists = __commonJS({
1124
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/path-exists/index.js"(exports, module) {
1125
+ init_esm_shims();
1126
+ var u = require_universalify().fromPromise;
1127
+ var fs4 = require_fs();
1128
+ function pathExists2(path5) {
1129
+ return fs4.access(path5).then(() => true).catch(() => false);
1130
+ }
1131
+ module.exports = {
1132
+ pathExists: u(pathExists2),
1133
+ pathExistsSync: fs4.existsSync
1134
+ };
1135
+ }
1136
+ });
1137
+
1138
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/util/utimes.js
1139
+ var require_utimes = __commonJS({
1140
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/util/utimes.js"(exports, module) {
1141
+ init_esm_shims();
1142
+ var fs4 = require_fs();
1143
+ var u = require_universalify().fromPromise;
1144
+ async function utimesMillis(path5, atime, mtime) {
1145
+ const fd = await fs4.open(path5, "r+");
1146
+ let closeErr = null;
1147
+ try {
1148
+ await fs4.futimes(fd, atime, mtime);
1149
+ } finally {
1150
+ try {
1151
+ await fs4.close(fd);
1152
+ } catch (e) {
1153
+ closeErr = e;
1154
+ }
1155
+ }
1156
+ if (closeErr) {
1157
+ throw closeErr;
1158
+ }
1159
+ }
1160
+ function utimesMillisSync(path5, atime, mtime) {
1161
+ const fd = fs4.openSync(path5, "r+");
1162
+ fs4.futimesSync(fd, atime, mtime);
1163
+ return fs4.closeSync(fd);
1164
+ }
1165
+ module.exports = {
1166
+ utimesMillis: u(utimesMillis),
1167
+ utimesMillisSync
1168
+ };
1169
+ }
1170
+ });
1171
+
1172
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/util/stat.js
1173
+ var require_stat = __commonJS({
1174
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/util/stat.js"(exports, module) {
1175
+ init_esm_shims();
1176
+ var fs4 = require_fs();
1177
+ var path5 = __require("path");
1178
+ var u = require_universalify().fromPromise;
1179
+ function getStats(src, dest, opts) {
1180
+ const statFunc = opts.dereference ? (file) => fs4.stat(file, { bigint: true }) : (file) => fs4.lstat(file, { bigint: true });
1181
+ return Promise.all([
1182
+ statFunc(src),
1183
+ statFunc(dest).catch((err) => {
1184
+ if (err.code === "ENOENT")
1185
+ return null;
1186
+ throw err;
1187
+ })
1188
+ ]).then(([srcStat, destStat]) => ({ srcStat, destStat }));
1189
+ }
1190
+ function getStatsSync(src, dest, opts) {
1191
+ let destStat;
1192
+ const statFunc = opts.dereference ? (file) => fs4.statSync(file, { bigint: true }) : (file) => fs4.lstatSync(file, { bigint: true });
1193
+ const srcStat = statFunc(src);
1194
+ try {
1195
+ destStat = statFunc(dest);
1196
+ } catch (err) {
1197
+ if (err.code === "ENOENT")
1198
+ return { srcStat, destStat: null };
1199
+ throw err;
1200
+ }
1201
+ return { srcStat, destStat };
1202
+ }
1203
+ async function checkPaths(src, dest, funcName, opts) {
1204
+ const { srcStat, destStat } = await getStats(src, dest, opts);
1205
+ if (destStat) {
1206
+ if (areIdentical(srcStat, destStat)) {
1207
+ const srcBaseName = path5.basename(src);
1208
+ const destBaseName = path5.basename(dest);
1209
+ if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
1210
+ return { srcStat, destStat, isChangingCase: true };
1211
+ }
1212
+ throw new Error("Source and destination must not be the same.");
1213
+ }
1214
+ if (srcStat.isDirectory() && !destStat.isDirectory()) {
1215
+ throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`);
1216
+ }
1217
+ if (!srcStat.isDirectory() && destStat.isDirectory()) {
1218
+ throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`);
1219
+ }
1220
+ }
1221
+ if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
1222
+ throw new Error(errMsg(src, dest, funcName));
1223
+ }
1224
+ return { srcStat, destStat };
1225
+ }
1226
+ function checkPathsSync(src, dest, funcName, opts) {
1227
+ const { srcStat, destStat } = getStatsSync(src, dest, opts);
1228
+ if (destStat) {
1229
+ if (areIdentical(srcStat, destStat)) {
1230
+ const srcBaseName = path5.basename(src);
1231
+ const destBaseName = path5.basename(dest);
1232
+ if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
1233
+ return { srcStat, destStat, isChangingCase: true };
1234
+ }
1235
+ throw new Error("Source and destination must not be the same.");
1236
+ }
1237
+ if (srcStat.isDirectory() && !destStat.isDirectory()) {
1238
+ throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`);
1239
+ }
1240
+ if (!srcStat.isDirectory() && destStat.isDirectory()) {
1241
+ throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`);
1242
+ }
1243
+ }
1244
+ if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
1245
+ throw new Error(errMsg(src, dest, funcName));
1246
+ }
1247
+ return { srcStat, destStat };
1248
+ }
1249
+ async function checkParentPaths(src, srcStat, dest, funcName) {
1250
+ const srcParent = path5.resolve(path5.dirname(src));
1251
+ const destParent = path5.resolve(path5.dirname(dest));
1252
+ if (destParent === srcParent || destParent === path5.parse(destParent).root)
1253
+ return;
1254
+ let destStat;
1255
+ try {
1256
+ destStat = await fs4.stat(destParent, { bigint: true });
1257
+ } catch (err) {
1258
+ if (err.code === "ENOENT")
1259
+ return;
1260
+ throw err;
1261
+ }
1262
+ if (areIdentical(srcStat, destStat)) {
1263
+ throw new Error(errMsg(src, dest, funcName));
1264
+ }
1265
+ return checkParentPaths(src, srcStat, destParent, funcName);
1266
+ }
1267
+ function checkParentPathsSync(src, srcStat, dest, funcName) {
1268
+ const srcParent = path5.resolve(path5.dirname(src));
1269
+ const destParent = path5.resolve(path5.dirname(dest));
1270
+ if (destParent === srcParent || destParent === path5.parse(destParent).root)
1271
+ return;
1272
+ let destStat;
1273
+ try {
1274
+ destStat = fs4.statSync(destParent, { bigint: true });
1275
+ } catch (err) {
1276
+ if (err.code === "ENOENT")
1277
+ return;
1278
+ throw err;
1279
+ }
1280
+ if (areIdentical(srcStat, destStat)) {
1281
+ throw new Error(errMsg(src, dest, funcName));
1282
+ }
1283
+ return checkParentPathsSync(src, srcStat, destParent, funcName);
1284
+ }
1285
+ function areIdentical(srcStat, destStat) {
1286
+ return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;
1287
+ }
1288
+ function isSrcSubdir(src, dest) {
1289
+ const srcArr = path5.resolve(src).split(path5.sep).filter((i) => i);
1290
+ const destArr = path5.resolve(dest).split(path5.sep).filter((i) => i);
1291
+ return srcArr.every((cur, i) => destArr[i] === cur);
1292
+ }
1293
+ function errMsg(src, dest, funcName) {
1294
+ return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`;
1295
+ }
1296
+ module.exports = {
1297
+ // checkPaths
1298
+ checkPaths: u(checkPaths),
1299
+ checkPathsSync,
1300
+ // checkParent
1301
+ checkParentPaths: u(checkParentPaths),
1302
+ checkParentPathsSync,
1303
+ // Misc
1304
+ isSrcSubdir,
1305
+ areIdentical
1306
+ };
1307
+ }
1308
+ });
1309
+
1310
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/copy.js
1311
+ var require_copy = __commonJS({
1312
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/copy.js"(exports, module) {
1313
+ init_esm_shims();
1314
+ var fs4 = require_fs();
1315
+ var path5 = __require("path");
1316
+ var { mkdirs } = require_mkdirs();
1317
+ var { pathExists: pathExists2 } = require_path_exists();
1318
+ var { utimesMillis } = require_utimes();
1319
+ var stat = require_stat();
1320
+ async function copy(src, dest, opts = {}) {
1321
+ if (typeof opts === "function") {
1322
+ opts = { filter: opts };
1323
+ }
1324
+ opts.clobber = "clobber" in opts ? !!opts.clobber : true;
1325
+ opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber;
1326
+ if (opts.preserveTimestamps && process.arch === "ia32") {
1327
+ process.emitWarning(
1328
+ "Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269",
1329
+ "Warning",
1330
+ "fs-extra-WARN0001"
1331
+ );
1332
+ }
1333
+ const { srcStat, destStat } = await stat.checkPaths(src, dest, "copy", opts);
1334
+ await stat.checkParentPaths(src, srcStat, dest, "copy");
1335
+ const include = await runFilter(src, dest, opts);
1336
+ if (!include)
1337
+ return;
1338
+ const destParent = path5.dirname(dest);
1339
+ const dirExists = await pathExists2(destParent);
1340
+ if (!dirExists) {
1341
+ await mkdirs(destParent);
1342
+ }
1343
+ await getStatsAndPerformCopy(destStat, src, dest, opts);
1344
+ }
1345
+ async function runFilter(src, dest, opts) {
1346
+ if (!opts.filter)
1347
+ return true;
1348
+ return opts.filter(src, dest);
1349
+ }
1350
+ async function getStatsAndPerformCopy(destStat, src, dest, opts) {
1351
+ const statFn = opts.dereference ? fs4.stat : fs4.lstat;
1352
+ const srcStat = await statFn(src);
1353
+ if (srcStat.isDirectory())
1354
+ return onDir(srcStat, destStat, src, dest, opts);
1355
+ if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice())
1356
+ return onFile(srcStat, destStat, src, dest, opts);
1357
+ if (srcStat.isSymbolicLink())
1358
+ return onLink(destStat, src, dest, opts);
1359
+ if (srcStat.isSocket())
1360
+ throw new Error(`Cannot copy a socket file: ${src}`);
1361
+ if (srcStat.isFIFO())
1362
+ throw new Error(`Cannot copy a FIFO pipe: ${src}`);
1363
+ throw new Error(`Unknown file: ${src}`);
1364
+ }
1365
+ async function onFile(srcStat, destStat, src, dest, opts) {
1366
+ if (!destStat)
1367
+ return copyFile(srcStat, src, dest, opts);
1368
+ if (opts.overwrite) {
1369
+ await fs4.unlink(dest);
1370
+ return copyFile(srcStat, src, dest, opts);
1371
+ }
1372
+ if (opts.errorOnExist) {
1373
+ throw new Error(`'${dest}' already exists`);
1374
+ }
1375
+ }
1376
+ async function copyFile(srcStat, src, dest, opts) {
1377
+ await fs4.copyFile(src, dest);
1378
+ if (opts.preserveTimestamps) {
1379
+ if (fileIsNotWritable(srcStat.mode)) {
1380
+ await makeFileWritable(dest, srcStat.mode);
1381
+ }
1382
+ const updatedSrcStat = await fs4.stat(src);
1383
+ await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
1384
+ }
1385
+ return fs4.chmod(dest, srcStat.mode);
1386
+ }
1387
+ function fileIsNotWritable(srcMode) {
1388
+ return (srcMode & 128) === 0;
1389
+ }
1390
+ function makeFileWritable(dest, srcMode) {
1391
+ return fs4.chmod(dest, srcMode | 128);
1392
+ }
1393
+ async function onDir(srcStat, destStat, src, dest, opts) {
1394
+ if (!destStat) {
1395
+ await fs4.mkdir(dest);
1396
+ }
1397
+ const items = await fs4.readdir(src);
1398
+ await Promise.all(items.map(async (item) => {
1399
+ const srcItem = path5.join(src, item);
1400
+ const destItem = path5.join(dest, item);
1401
+ const include = await runFilter(srcItem, destItem, opts);
1402
+ if (!include)
1403
+ return;
1404
+ const { destStat: destStat2 } = await stat.checkPaths(srcItem, destItem, "copy", opts);
1405
+ return getStatsAndPerformCopy(destStat2, srcItem, destItem, opts);
1406
+ }));
1407
+ if (!destStat) {
1408
+ await fs4.chmod(dest, srcStat.mode);
1409
+ }
1410
+ }
1411
+ async function onLink(destStat, src, dest, opts) {
1412
+ let resolvedSrc = await fs4.readlink(src);
1413
+ if (opts.dereference) {
1414
+ resolvedSrc = path5.resolve(process.cwd(), resolvedSrc);
1415
+ }
1416
+ if (!destStat) {
1417
+ return fs4.symlink(resolvedSrc, dest);
1418
+ }
1419
+ let resolvedDest = null;
1420
+ try {
1421
+ resolvedDest = await fs4.readlink(dest);
1422
+ } catch (e) {
1423
+ if (e.code === "EINVAL" || e.code === "UNKNOWN")
1424
+ return fs4.symlink(resolvedSrc, dest);
1425
+ throw e;
1426
+ }
1427
+ if (opts.dereference) {
1428
+ resolvedDest = path5.resolve(process.cwd(), resolvedDest);
1429
+ }
1430
+ if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
1431
+ throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
1432
+ }
1433
+ if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
1434
+ throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
1435
+ }
1436
+ await fs4.unlink(dest);
1437
+ return fs4.symlink(resolvedSrc, dest);
1438
+ }
1439
+ module.exports = copy;
1440
+ }
1441
+ });
1442
+
1443
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/copy-sync.js
1444
+ var require_copy_sync = __commonJS({
1445
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/copy-sync.js"(exports, module) {
1446
+ init_esm_shims();
1447
+ var fs4 = require_graceful_fs();
1448
+ var path5 = __require("path");
1449
+ var mkdirsSync = require_mkdirs().mkdirsSync;
1450
+ var utimesMillisSync = require_utimes().utimesMillisSync;
1451
+ var stat = require_stat();
1452
+ function copySync(src, dest, opts) {
1453
+ if (typeof opts === "function") {
1454
+ opts = { filter: opts };
1455
+ }
1456
+ opts = opts || {};
1457
+ opts.clobber = "clobber" in opts ? !!opts.clobber : true;
1458
+ opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber;
1459
+ if (opts.preserveTimestamps && process.arch === "ia32") {
1460
+ process.emitWarning(
1461
+ "Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269",
1462
+ "Warning",
1463
+ "fs-extra-WARN0002"
1464
+ );
1465
+ }
1466
+ const { srcStat, destStat } = stat.checkPathsSync(src, dest, "copy", opts);
1467
+ stat.checkParentPathsSync(src, srcStat, dest, "copy");
1468
+ if (opts.filter && !opts.filter(src, dest))
1469
+ return;
1470
+ const destParent = path5.dirname(dest);
1471
+ if (!fs4.existsSync(destParent))
1472
+ mkdirsSync(destParent);
1473
+ return getStats(destStat, src, dest, opts);
1474
+ }
1475
+ function getStats(destStat, src, dest, opts) {
1476
+ const statSync = opts.dereference ? fs4.statSync : fs4.lstatSync;
1477
+ const srcStat = statSync(src);
1478
+ if (srcStat.isDirectory())
1479
+ return onDir(srcStat, destStat, src, dest, opts);
1480
+ else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice())
1481
+ return onFile(srcStat, destStat, src, dest, opts);
1482
+ else if (srcStat.isSymbolicLink())
1483
+ return onLink(destStat, src, dest, opts);
1484
+ else if (srcStat.isSocket())
1485
+ throw new Error(`Cannot copy a socket file: ${src}`);
1486
+ else if (srcStat.isFIFO())
1487
+ throw new Error(`Cannot copy a FIFO pipe: ${src}`);
1488
+ throw new Error(`Unknown file: ${src}`);
1489
+ }
1490
+ function onFile(srcStat, destStat, src, dest, opts) {
1491
+ if (!destStat)
1492
+ return copyFile(srcStat, src, dest, opts);
1493
+ return mayCopyFile(srcStat, src, dest, opts);
1494
+ }
1495
+ function mayCopyFile(srcStat, src, dest, opts) {
1496
+ if (opts.overwrite) {
1497
+ fs4.unlinkSync(dest);
1498
+ return copyFile(srcStat, src, dest, opts);
1499
+ } else if (opts.errorOnExist) {
1500
+ throw new Error(`'${dest}' already exists`);
1501
+ }
1502
+ }
1503
+ function copyFile(srcStat, src, dest, opts) {
1504
+ fs4.copyFileSync(src, dest);
1505
+ if (opts.preserveTimestamps)
1506
+ handleTimestamps(srcStat.mode, src, dest);
1507
+ return setDestMode(dest, srcStat.mode);
1508
+ }
1509
+ function handleTimestamps(srcMode, src, dest) {
1510
+ if (fileIsNotWritable(srcMode))
1511
+ makeFileWritable(dest, srcMode);
1512
+ return setDestTimestamps(src, dest);
1513
+ }
1514
+ function fileIsNotWritable(srcMode) {
1515
+ return (srcMode & 128) === 0;
1516
+ }
1517
+ function makeFileWritable(dest, srcMode) {
1518
+ return setDestMode(dest, srcMode | 128);
1519
+ }
1520
+ function setDestMode(dest, srcMode) {
1521
+ return fs4.chmodSync(dest, srcMode);
1522
+ }
1523
+ function setDestTimestamps(src, dest) {
1524
+ const updatedSrcStat = fs4.statSync(src);
1525
+ return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
1526
+ }
1527
+ function onDir(srcStat, destStat, src, dest, opts) {
1528
+ if (!destStat)
1529
+ return mkDirAndCopy(srcStat.mode, src, dest, opts);
1530
+ return copyDir(src, dest, opts);
1531
+ }
1532
+ function mkDirAndCopy(srcMode, src, dest, opts) {
1533
+ fs4.mkdirSync(dest);
1534
+ copyDir(src, dest, opts);
1535
+ return setDestMode(dest, srcMode);
1536
+ }
1537
+ function copyDir(src, dest, opts) {
1538
+ fs4.readdirSync(src).forEach((item) => copyDirItem(item, src, dest, opts));
1539
+ }
1540
+ function copyDirItem(item, src, dest, opts) {
1541
+ const srcItem = path5.join(src, item);
1542
+ const destItem = path5.join(dest, item);
1543
+ if (opts.filter && !opts.filter(srcItem, destItem))
1544
+ return;
1545
+ const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy", opts);
1546
+ return getStats(destStat, srcItem, destItem, opts);
1547
+ }
1548
+ function onLink(destStat, src, dest, opts) {
1549
+ let resolvedSrc = fs4.readlinkSync(src);
1550
+ if (opts.dereference) {
1551
+ resolvedSrc = path5.resolve(process.cwd(), resolvedSrc);
1552
+ }
1553
+ if (!destStat) {
1554
+ return fs4.symlinkSync(resolvedSrc, dest);
1555
+ } else {
1556
+ let resolvedDest;
1557
+ try {
1558
+ resolvedDest = fs4.readlinkSync(dest);
1559
+ } catch (err) {
1560
+ if (err.code === "EINVAL" || err.code === "UNKNOWN")
1561
+ return fs4.symlinkSync(resolvedSrc, dest);
1562
+ throw err;
1563
+ }
1564
+ if (opts.dereference) {
1565
+ resolvedDest = path5.resolve(process.cwd(), resolvedDest);
1566
+ }
1567
+ if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
1568
+ throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
1569
+ }
1570
+ if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
1571
+ throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
1572
+ }
1573
+ return copyLink(resolvedSrc, dest);
1574
+ }
1575
+ }
1576
+ function copyLink(resolvedSrc, dest) {
1577
+ fs4.unlinkSync(dest);
1578
+ return fs4.symlinkSync(resolvedSrc, dest);
1579
+ }
1580
+ module.exports = copySync;
1581
+ }
1582
+ });
1583
+
1584
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/index.js
1585
+ var require_copy2 = __commonJS({
1586
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/index.js"(exports, module) {
1587
+ init_esm_shims();
1588
+ var u = require_universalify().fromPromise;
1589
+ module.exports = {
1590
+ copy: u(require_copy()),
1591
+ copySync: require_copy_sync()
1592
+ };
1593
+ }
1594
+ });
1595
+
1596
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/remove/index.js
1597
+ var require_remove = __commonJS({
1598
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/remove/index.js"(exports, module) {
1599
+ init_esm_shims();
1600
+ var fs4 = require_graceful_fs();
1601
+ var u = require_universalify().fromCallback;
1602
+ function remove2(path5, callback) {
1603
+ fs4.rm(path5, { recursive: true, force: true }, callback);
1604
+ }
1605
+ function removeSync(path5) {
1606
+ fs4.rmSync(path5, { recursive: true, force: true });
1607
+ }
1608
+ module.exports = {
1609
+ remove: u(remove2),
1610
+ removeSync
1611
+ };
1612
+ }
1613
+ });
1614
+
1615
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/empty/index.js
1616
+ var require_empty = __commonJS({
1617
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/empty/index.js"(exports, module) {
1618
+ init_esm_shims();
1619
+ var u = require_universalify().fromPromise;
1620
+ var fs4 = require_fs();
1621
+ var path5 = __require("path");
1622
+ var mkdir = require_mkdirs();
1623
+ var remove2 = require_remove();
1624
+ var emptyDir = u(async function emptyDir2(dir) {
1625
+ let items;
1626
+ try {
1627
+ items = await fs4.readdir(dir);
1628
+ } catch {
1629
+ return mkdir.mkdirs(dir);
1630
+ }
1631
+ return Promise.all(items.map((item) => remove2.remove(path5.join(dir, item))));
1632
+ });
1633
+ function emptyDirSync(dir) {
1634
+ let items;
1635
+ try {
1636
+ items = fs4.readdirSync(dir);
1637
+ } catch {
1638
+ return mkdir.mkdirsSync(dir);
1639
+ }
1640
+ items.forEach((item) => {
1641
+ item = path5.join(dir, item);
1642
+ remove2.removeSync(item);
1643
+ });
1644
+ }
1645
+ module.exports = {
1646
+ emptyDirSync,
1647
+ emptydirSync: emptyDirSync,
1648
+ emptyDir,
1649
+ emptydir: emptyDir
1650
+ };
1651
+ }
1652
+ });
1653
+
1654
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/file.js
1655
+ var require_file = __commonJS({
1656
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/file.js"(exports, module) {
1657
+ init_esm_shims();
1658
+ var u = require_universalify().fromPromise;
1659
+ var path5 = __require("path");
1660
+ var fs4 = require_fs();
1661
+ var mkdir = require_mkdirs();
1662
+ async function createFile(file) {
1663
+ let stats;
1664
+ try {
1665
+ stats = await fs4.stat(file);
1666
+ } catch {
1667
+ }
1668
+ if (stats && stats.isFile())
1669
+ return;
1670
+ const dir = path5.dirname(file);
1671
+ let dirStats = null;
1672
+ try {
1673
+ dirStats = await fs4.stat(dir);
1674
+ } catch (err) {
1675
+ if (err.code === "ENOENT") {
1676
+ await mkdir.mkdirs(dir);
1677
+ await fs4.writeFile(file, "");
1678
+ return;
1679
+ } else {
1680
+ throw err;
1681
+ }
1682
+ }
1683
+ if (dirStats.isDirectory()) {
1684
+ await fs4.writeFile(file, "");
1685
+ } else {
1686
+ await fs4.readdir(dir);
1687
+ }
1688
+ }
1689
+ function createFileSync(file) {
1690
+ let stats;
1691
+ try {
1692
+ stats = fs4.statSync(file);
1693
+ } catch {
1694
+ }
1695
+ if (stats && stats.isFile())
1696
+ return;
1697
+ const dir = path5.dirname(file);
1698
+ try {
1699
+ if (!fs4.statSync(dir).isDirectory()) {
1700
+ fs4.readdirSync(dir);
1701
+ }
1702
+ } catch (err) {
1703
+ if (err && err.code === "ENOENT")
1704
+ mkdir.mkdirsSync(dir);
1705
+ else
1706
+ throw err;
1707
+ }
1708
+ fs4.writeFileSync(file, "");
1709
+ }
1710
+ module.exports = {
1711
+ createFile: u(createFile),
1712
+ createFileSync
1713
+ };
1714
+ }
1715
+ });
1716
+
1717
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/link.js
1718
+ var require_link = __commonJS({
1719
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/link.js"(exports, module) {
1720
+ init_esm_shims();
1721
+ var u = require_universalify().fromPromise;
1722
+ var path5 = __require("path");
1723
+ var fs4 = require_fs();
1724
+ var mkdir = require_mkdirs();
1725
+ var { pathExists: pathExists2 } = require_path_exists();
1726
+ var { areIdentical } = require_stat();
1727
+ async function createLink(srcpath, dstpath) {
1728
+ let dstStat;
1729
+ try {
1730
+ dstStat = await fs4.lstat(dstpath);
1731
+ } catch {
1732
+ }
1733
+ let srcStat;
1734
+ try {
1735
+ srcStat = await fs4.lstat(srcpath);
1736
+ } catch (err) {
1737
+ err.message = err.message.replace("lstat", "ensureLink");
1738
+ throw err;
1739
+ }
1740
+ if (dstStat && areIdentical(srcStat, dstStat))
1741
+ return;
1742
+ const dir = path5.dirname(dstpath);
1743
+ const dirExists = await pathExists2(dir);
1744
+ if (!dirExists) {
1745
+ await mkdir.mkdirs(dir);
1746
+ }
1747
+ await fs4.link(srcpath, dstpath);
1748
+ }
1749
+ function createLinkSync(srcpath, dstpath) {
1750
+ let dstStat;
1751
+ try {
1752
+ dstStat = fs4.lstatSync(dstpath);
1753
+ } catch {
1754
+ }
1755
+ try {
1756
+ const srcStat = fs4.lstatSync(srcpath);
1757
+ if (dstStat && areIdentical(srcStat, dstStat))
1758
+ return;
1759
+ } catch (err) {
1760
+ err.message = err.message.replace("lstat", "ensureLink");
1761
+ throw err;
1762
+ }
1763
+ const dir = path5.dirname(dstpath);
1764
+ const dirExists = fs4.existsSync(dir);
1765
+ if (dirExists)
1766
+ return fs4.linkSync(srcpath, dstpath);
1767
+ mkdir.mkdirsSync(dir);
1768
+ return fs4.linkSync(srcpath, dstpath);
1769
+ }
1770
+ module.exports = {
1771
+ createLink: u(createLink),
1772
+ createLinkSync
1773
+ };
1774
+ }
1775
+ });
1776
+
1777
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink-paths.js
1778
+ var require_symlink_paths = __commonJS({
1779
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports, module) {
1780
+ init_esm_shims();
1781
+ var path5 = __require("path");
1782
+ var fs4 = require_fs();
1783
+ var { pathExists: pathExists2 } = require_path_exists();
1784
+ var u = require_universalify().fromPromise;
1785
+ async function symlinkPaths(srcpath, dstpath) {
1786
+ if (path5.isAbsolute(srcpath)) {
1787
+ try {
1788
+ await fs4.lstat(srcpath);
1789
+ } catch (err) {
1790
+ err.message = err.message.replace("lstat", "ensureSymlink");
1791
+ throw err;
1792
+ }
1793
+ return {
1794
+ toCwd: srcpath,
1795
+ toDst: srcpath
1796
+ };
1797
+ }
1798
+ const dstdir = path5.dirname(dstpath);
1799
+ const relativeToDst = path5.join(dstdir, srcpath);
1800
+ const exists = await pathExists2(relativeToDst);
1801
+ if (exists) {
1802
+ return {
1803
+ toCwd: relativeToDst,
1804
+ toDst: srcpath
1805
+ };
1806
+ }
1807
+ try {
1808
+ await fs4.lstat(srcpath);
1809
+ } catch (err) {
1810
+ err.message = err.message.replace("lstat", "ensureSymlink");
1811
+ throw err;
1812
+ }
1813
+ return {
1814
+ toCwd: srcpath,
1815
+ toDst: path5.relative(dstdir, srcpath)
1816
+ };
1817
+ }
1818
+ function symlinkPathsSync(srcpath, dstpath) {
1819
+ if (path5.isAbsolute(srcpath)) {
1820
+ const exists2 = fs4.existsSync(srcpath);
1821
+ if (!exists2)
1822
+ throw new Error("absolute srcpath does not exist");
1823
+ return {
1824
+ toCwd: srcpath,
1825
+ toDst: srcpath
1826
+ };
1827
+ }
1828
+ const dstdir = path5.dirname(dstpath);
1829
+ const relativeToDst = path5.join(dstdir, srcpath);
1830
+ const exists = fs4.existsSync(relativeToDst);
1831
+ if (exists) {
1832
+ return {
1833
+ toCwd: relativeToDst,
1834
+ toDst: srcpath
1835
+ };
1836
+ }
1837
+ const srcExists = fs4.existsSync(srcpath);
1838
+ if (!srcExists)
1839
+ throw new Error("relative srcpath does not exist");
1840
+ return {
1841
+ toCwd: srcpath,
1842
+ toDst: path5.relative(dstdir, srcpath)
1843
+ };
1844
+ }
1845
+ module.exports = {
1846
+ symlinkPaths: u(symlinkPaths),
1847
+ symlinkPathsSync
1848
+ };
1849
+ }
1850
+ });
1851
+
1852
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink-type.js
1853
+ var require_symlink_type = __commonJS({
1854
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink-type.js"(exports, module) {
1855
+ init_esm_shims();
1856
+ var fs4 = require_fs();
1857
+ var u = require_universalify().fromPromise;
1858
+ async function symlinkType(srcpath, type) {
1859
+ if (type)
1860
+ return type;
1861
+ let stats;
1862
+ try {
1863
+ stats = await fs4.lstat(srcpath);
1864
+ } catch {
1865
+ return "file";
1866
+ }
1867
+ return stats && stats.isDirectory() ? "dir" : "file";
1868
+ }
1869
+ function symlinkTypeSync(srcpath, type) {
1870
+ if (type)
1871
+ return type;
1872
+ let stats;
1873
+ try {
1874
+ stats = fs4.lstatSync(srcpath);
1875
+ } catch {
1876
+ return "file";
1877
+ }
1878
+ return stats && stats.isDirectory() ? "dir" : "file";
1879
+ }
1880
+ module.exports = {
1881
+ symlinkType: u(symlinkType),
1882
+ symlinkTypeSync
1883
+ };
1884
+ }
1885
+ });
1886
+
1887
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink.js
1888
+ var require_symlink = __commonJS({
1889
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink.js"(exports, module) {
1890
+ init_esm_shims();
1891
+ var u = require_universalify().fromPromise;
1892
+ var path5 = __require("path");
1893
+ var fs4 = require_fs();
1894
+ var { mkdirs, mkdirsSync } = require_mkdirs();
1895
+ var { symlinkPaths, symlinkPathsSync } = require_symlink_paths();
1896
+ var { symlinkType, symlinkTypeSync } = require_symlink_type();
1897
+ var { pathExists: pathExists2 } = require_path_exists();
1898
+ var { areIdentical } = require_stat();
1899
+ async function createSymlink(srcpath, dstpath, type) {
1900
+ let stats;
1901
+ try {
1902
+ stats = await fs4.lstat(dstpath);
1903
+ } catch {
1904
+ }
1905
+ if (stats && stats.isSymbolicLink()) {
1906
+ const [srcStat, dstStat] = await Promise.all([
1907
+ fs4.stat(srcpath),
1908
+ fs4.stat(dstpath)
1909
+ ]);
1910
+ if (areIdentical(srcStat, dstStat))
1911
+ return;
1912
+ }
1913
+ const relative2 = await symlinkPaths(srcpath, dstpath);
1914
+ srcpath = relative2.toDst;
1915
+ const toType = await symlinkType(relative2.toCwd, type);
1916
+ const dir = path5.dirname(dstpath);
1917
+ if (!await pathExists2(dir)) {
1918
+ await mkdirs(dir);
1919
+ }
1920
+ return fs4.symlink(srcpath, dstpath, toType);
1921
+ }
1922
+ function createSymlinkSync(srcpath, dstpath, type) {
1923
+ let stats;
1924
+ try {
1925
+ stats = fs4.lstatSync(dstpath);
1926
+ } catch {
1927
+ }
1928
+ if (stats && stats.isSymbolicLink()) {
1929
+ const srcStat = fs4.statSync(srcpath);
1930
+ const dstStat = fs4.statSync(dstpath);
1931
+ if (areIdentical(srcStat, dstStat))
1932
+ return;
1933
+ }
1934
+ const relative2 = symlinkPathsSync(srcpath, dstpath);
1935
+ srcpath = relative2.toDst;
1936
+ type = symlinkTypeSync(relative2.toCwd, type);
1937
+ const dir = path5.dirname(dstpath);
1938
+ const exists = fs4.existsSync(dir);
1939
+ if (exists)
1940
+ return fs4.symlinkSync(srcpath, dstpath, type);
1941
+ mkdirsSync(dir);
1942
+ return fs4.symlinkSync(srcpath, dstpath, type);
1943
+ }
1944
+ module.exports = {
1945
+ createSymlink: u(createSymlink),
1946
+ createSymlinkSync
1947
+ };
1948
+ }
1949
+ });
1950
+
1951
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/index.js
1952
+ var require_ensure = __commonJS({
1953
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/index.js"(exports, module) {
1954
+ init_esm_shims();
1955
+ var { createFile, createFileSync } = require_file();
1956
+ var { createLink, createLinkSync } = require_link();
1957
+ var { createSymlink, createSymlinkSync } = require_symlink();
1958
+ module.exports = {
1959
+ // file
1960
+ createFile,
1961
+ createFileSync,
1962
+ ensureFile: createFile,
1963
+ ensureFileSync: createFileSync,
1964
+ // link
1965
+ createLink,
1966
+ createLinkSync,
1967
+ ensureLink: createLink,
1968
+ ensureLinkSync: createLinkSync,
1969
+ // symlink
1970
+ createSymlink,
1971
+ createSymlinkSync,
1972
+ ensureSymlink: createSymlink,
1973
+ ensureSymlinkSync: createSymlinkSync
1974
+ };
1975
+ }
1976
+ });
1977
+
1978
+ // ../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/utils.js
1979
+ var require_utils2 = __commonJS({
1980
+ "../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/utils.js"(exports, module) {
1981
+ init_esm_shims();
1982
+ function stringify(obj, { EOL = "\n", finalEOL = true, replacer = null, spaces } = {}) {
1983
+ const EOF = finalEOL ? EOL : "";
1984
+ const str = JSON.stringify(obj, replacer, spaces);
1985
+ return str.replace(/\n/g, EOL) + EOF;
1986
+ }
1987
+ function stripBom(content) {
1988
+ if (Buffer.isBuffer(content))
1989
+ content = content.toString("utf8");
1990
+ return content.replace(/^\uFEFF/, "");
1991
+ }
1992
+ module.exports = { stringify, stripBom };
1993
+ }
1994
+ });
1995
+
1996
+ // ../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/index.js
1997
+ var require_jsonfile = __commonJS({
1998
+ "../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/index.js"(exports, module) {
1999
+ init_esm_shims();
2000
+ var _fs;
2001
+ try {
2002
+ _fs = require_graceful_fs();
2003
+ } catch (_) {
2004
+ _fs = __require("fs");
2005
+ }
2006
+ var universalify = require_universalify();
2007
+ var { stringify, stripBom } = require_utils2();
2008
+ async function _readFile(file, options = {}) {
2009
+ if (typeof options === "string") {
2010
+ options = { encoding: options };
2011
+ }
2012
+ const fs4 = options.fs || _fs;
2013
+ const shouldThrow = "throws" in options ? options.throws : true;
2014
+ let data = await universalify.fromCallback(fs4.readFile)(file, options);
2015
+ data = stripBom(data);
2016
+ let obj;
2017
+ try {
2018
+ obj = JSON.parse(data, options ? options.reviver : null);
2019
+ } catch (err) {
2020
+ if (shouldThrow) {
2021
+ err.message = `${file}: ${err.message}`;
2022
+ throw err;
2023
+ } else {
2024
+ return null;
2025
+ }
2026
+ }
2027
+ return obj;
2028
+ }
2029
+ var readFile = universalify.fromPromise(_readFile);
2030
+ function readFileSync(file, options = {}) {
2031
+ if (typeof options === "string") {
2032
+ options = { encoding: options };
2033
+ }
2034
+ const fs4 = options.fs || _fs;
2035
+ const shouldThrow = "throws" in options ? options.throws : true;
2036
+ try {
2037
+ let content = fs4.readFileSync(file, options);
2038
+ content = stripBom(content);
2039
+ return JSON.parse(content, options.reviver);
2040
+ } catch (err) {
2041
+ if (shouldThrow) {
2042
+ err.message = `${file}: ${err.message}`;
2043
+ throw err;
2044
+ } else {
2045
+ return null;
2046
+ }
2047
+ }
2048
+ }
2049
+ async function _writeFile(file, obj, options = {}) {
2050
+ const fs4 = options.fs || _fs;
2051
+ const str = stringify(obj, options);
2052
+ await universalify.fromCallback(fs4.writeFile)(file, str, options);
2053
+ }
2054
+ var writeFile = universalify.fromPromise(_writeFile);
2055
+ function writeFileSync(file, obj, options = {}) {
2056
+ const fs4 = options.fs || _fs;
2057
+ const str = stringify(obj, options);
2058
+ return fs4.writeFileSync(file, str, options);
2059
+ }
2060
+ var jsonfile = {
2061
+ readFile,
2062
+ readFileSync,
2063
+ writeFile,
2064
+ writeFileSync
2065
+ };
2066
+ module.exports = jsonfile;
2067
+ }
2068
+ });
2069
+
2070
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/jsonfile.js
2071
+ var require_jsonfile2 = __commonJS({
2072
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/jsonfile.js"(exports, module) {
2073
+ init_esm_shims();
2074
+ var jsonFile = require_jsonfile();
2075
+ module.exports = {
2076
+ // jsonfile exports
2077
+ readJson: jsonFile.readFile,
2078
+ readJsonSync: jsonFile.readFileSync,
2079
+ writeJson: jsonFile.writeFile,
2080
+ writeJsonSync: jsonFile.writeFileSync
2081
+ };
2082
+ }
2083
+ });
2084
+
2085
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/output-file/index.js
2086
+ var require_output_file = __commonJS({
2087
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/output-file/index.js"(exports, module) {
2088
+ init_esm_shims();
2089
+ var u = require_universalify().fromPromise;
2090
+ var fs4 = require_fs();
2091
+ var path5 = __require("path");
2092
+ var mkdir = require_mkdirs();
2093
+ var pathExists2 = require_path_exists().pathExists;
2094
+ async function outputFile(file, data, encoding = "utf-8") {
2095
+ const dir = path5.dirname(file);
2096
+ if (!await pathExists2(dir)) {
2097
+ await mkdir.mkdirs(dir);
2098
+ }
2099
+ return fs4.writeFile(file, data, encoding);
2100
+ }
2101
+ function outputFileSync(file, ...args) {
2102
+ const dir = path5.dirname(file);
2103
+ if (!fs4.existsSync(dir)) {
2104
+ mkdir.mkdirsSync(dir);
2105
+ }
2106
+ fs4.writeFileSync(file, ...args);
2107
+ }
2108
+ module.exports = {
2109
+ outputFile: u(outputFile),
2110
+ outputFileSync
2111
+ };
2112
+ }
2113
+ });
2114
+
2115
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/output-json.js
2116
+ var require_output_json = __commonJS({
2117
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/output-json.js"(exports, module) {
2118
+ init_esm_shims();
2119
+ var { stringify } = require_utils2();
2120
+ var { outputFile } = require_output_file();
2121
+ async function outputJson(file, data, options = {}) {
2122
+ const str = stringify(data, options);
2123
+ await outputFile(file, str, options);
2124
+ }
2125
+ module.exports = outputJson;
2126
+ }
2127
+ });
2128
+
2129
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/output-json-sync.js
2130
+ var require_output_json_sync = __commonJS({
2131
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/output-json-sync.js"(exports, module) {
2132
+ init_esm_shims();
2133
+ var { stringify } = require_utils2();
2134
+ var { outputFileSync } = require_output_file();
2135
+ function outputJsonSync(file, data, options) {
2136
+ const str = stringify(data, options);
2137
+ outputFileSync(file, str, options);
2138
+ }
2139
+ module.exports = outputJsonSync;
2140
+ }
2141
+ });
2142
+
2143
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/index.js
2144
+ var require_json = __commonJS({
2145
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/index.js"(exports, module) {
2146
+ init_esm_shims();
2147
+ var u = require_universalify().fromPromise;
2148
+ var jsonFile = require_jsonfile2();
2149
+ jsonFile.outputJson = u(require_output_json());
2150
+ jsonFile.outputJsonSync = require_output_json_sync();
2151
+ jsonFile.outputJSON = jsonFile.outputJson;
2152
+ jsonFile.outputJSONSync = jsonFile.outputJsonSync;
2153
+ jsonFile.writeJSON = jsonFile.writeJson;
2154
+ jsonFile.writeJSONSync = jsonFile.writeJsonSync;
2155
+ jsonFile.readJSON = jsonFile.readJson;
2156
+ jsonFile.readJSONSync = jsonFile.readJsonSync;
2157
+ module.exports = jsonFile;
2158
+ }
2159
+ });
2160
+
2161
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/move.js
2162
+ var require_move = __commonJS({
2163
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/move.js"(exports, module) {
2164
+ init_esm_shims();
2165
+ var fs4 = require_fs();
2166
+ var path5 = __require("path");
2167
+ var { copy } = require_copy2();
2168
+ var { remove: remove2 } = require_remove();
2169
+ var { mkdirp } = require_mkdirs();
2170
+ var { pathExists: pathExists2 } = require_path_exists();
2171
+ var stat = require_stat();
2172
+ async function move(src, dest, opts = {}) {
2173
+ const overwrite = opts.overwrite || opts.clobber || false;
2174
+ const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, "move", opts);
2175
+ await stat.checkParentPaths(src, srcStat, dest, "move");
2176
+ const destParent = path5.dirname(dest);
2177
+ const parsedParentPath = path5.parse(destParent);
2178
+ if (parsedParentPath.root !== destParent) {
2179
+ await mkdirp(destParent);
2180
+ }
2181
+ return doRename(src, dest, overwrite, isChangingCase);
2182
+ }
2183
+ async function doRename(src, dest, overwrite, isChangingCase) {
2184
+ if (!isChangingCase) {
2185
+ if (overwrite) {
2186
+ await remove2(dest);
2187
+ } else if (await pathExists2(dest)) {
2188
+ throw new Error("dest already exists.");
2189
+ }
2190
+ }
2191
+ try {
2192
+ await fs4.rename(src, dest);
2193
+ } catch (err) {
2194
+ if (err.code !== "EXDEV") {
2195
+ throw err;
2196
+ }
2197
+ await moveAcrossDevice(src, dest, overwrite);
2198
+ }
2199
+ }
2200
+ async function moveAcrossDevice(src, dest, overwrite) {
2201
+ const opts = {
2202
+ overwrite,
2203
+ errorOnExist: true,
2204
+ preserveTimestamps: true
2205
+ };
2206
+ await copy(src, dest, opts);
2207
+ return remove2(src);
2208
+ }
2209
+ module.exports = move;
2210
+ }
2211
+ });
2212
+
2213
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/move-sync.js
2214
+ var require_move_sync = __commonJS({
2215
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/move-sync.js"(exports, module) {
2216
+ init_esm_shims();
2217
+ var fs4 = require_graceful_fs();
2218
+ var path5 = __require("path");
2219
+ var copySync = require_copy2().copySync;
2220
+ var removeSync = require_remove().removeSync;
2221
+ var mkdirpSync = require_mkdirs().mkdirpSync;
2222
+ var stat = require_stat();
2223
+ function moveSync(src, dest, opts) {
2224
+ opts = opts || {};
2225
+ const overwrite = opts.overwrite || opts.clobber || false;
2226
+ const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, "move", opts);
2227
+ stat.checkParentPathsSync(src, srcStat, dest, "move");
2228
+ if (!isParentRoot(dest))
2229
+ mkdirpSync(path5.dirname(dest));
2230
+ return doRename(src, dest, overwrite, isChangingCase);
2231
+ }
2232
+ function isParentRoot(dest) {
2233
+ const parent = path5.dirname(dest);
2234
+ const parsedPath = path5.parse(parent);
2235
+ return parsedPath.root === parent;
2236
+ }
2237
+ function doRename(src, dest, overwrite, isChangingCase) {
2238
+ if (isChangingCase)
2239
+ return rename(src, dest, overwrite);
2240
+ if (overwrite) {
2241
+ removeSync(dest);
2242
+ return rename(src, dest, overwrite);
2243
+ }
2244
+ if (fs4.existsSync(dest))
2245
+ throw new Error("dest already exists.");
2246
+ return rename(src, dest, overwrite);
2247
+ }
2248
+ function rename(src, dest, overwrite) {
2249
+ try {
2250
+ fs4.renameSync(src, dest);
2251
+ } catch (err) {
2252
+ if (err.code !== "EXDEV")
2253
+ throw err;
2254
+ return moveAcrossDevice(src, dest, overwrite);
2255
+ }
2256
+ }
2257
+ function moveAcrossDevice(src, dest, overwrite) {
2258
+ const opts = {
2259
+ overwrite,
2260
+ errorOnExist: true,
2261
+ preserveTimestamps: true
2262
+ };
2263
+ copySync(src, dest, opts);
2264
+ return removeSync(src);
2265
+ }
2266
+ module.exports = moveSync;
2267
+ }
2268
+ });
2269
+
2270
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/index.js
2271
+ var require_move2 = __commonJS({
2272
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/index.js"(exports, module) {
2273
+ init_esm_shims();
2274
+ var u = require_universalify().fromPromise;
2275
+ module.exports = {
2276
+ move: u(require_move()),
2277
+ moveSync: require_move_sync()
2278
+ };
2279
+ }
2280
+ });
2281
+
2282
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/index.js
2283
+ var require_lib = __commonJS({
2284
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/index.js"(exports, module) {
2285
+ init_esm_shims();
2286
+ module.exports = {
2287
+ // Export promiseified graceful-fs:
2288
+ ...require_fs(),
2289
+ // Export extra methods:
2290
+ ...require_copy2(),
2291
+ ...require_empty(),
2292
+ ...require_ensure(),
2293
+ ...require_json(),
2294
+ ...require_mkdirs(),
2295
+ ...require_move2(),
2296
+ ...require_output_file(),
2297
+ ...require_path_exists(),
2298
+ ...require_remove()
2299
+ };
2300
+ }
2301
+ });
2302
+
2303
+ // ../../node_modules/.pnpm/lodash.isequal@4.5.0/node_modules/lodash.isequal/index.js
2304
+ var require_lodash = __commonJS({
2305
+ "../../node_modules/.pnpm/lodash.isequal@4.5.0/node_modules/lodash.isequal/index.js"(exports, module) {
2306
+ init_esm_shims();
2307
+ var LARGE_ARRAY_SIZE = 200;
2308
+ var HASH_UNDEFINED = "__lodash_hash_undefined__";
2309
+ var COMPARE_PARTIAL_FLAG = 1;
2310
+ var COMPARE_UNORDERED_FLAG = 2;
2311
+ var MAX_SAFE_INTEGER = 9007199254740991;
2312
+ var argsTag = "[object Arguments]";
2313
+ var arrayTag = "[object Array]";
2314
+ var asyncTag = "[object AsyncFunction]";
2315
+ var boolTag = "[object Boolean]";
2316
+ var dateTag = "[object Date]";
2317
+ var errorTag = "[object Error]";
2318
+ var funcTag = "[object Function]";
2319
+ var genTag = "[object GeneratorFunction]";
2320
+ var mapTag = "[object Map]";
2321
+ var numberTag = "[object Number]";
2322
+ var nullTag = "[object Null]";
2323
+ var objectTag = "[object Object]";
2324
+ var promiseTag = "[object Promise]";
2325
+ var proxyTag = "[object Proxy]";
2326
+ var regexpTag = "[object RegExp]";
2327
+ var setTag = "[object Set]";
2328
+ var stringTag = "[object String]";
2329
+ var symbolTag = "[object Symbol]";
2330
+ var undefinedTag = "[object Undefined]";
2331
+ var weakMapTag = "[object WeakMap]";
2332
+ var arrayBufferTag = "[object ArrayBuffer]";
2333
+ var dataViewTag = "[object DataView]";
2334
+ var float32Tag = "[object Float32Array]";
2335
+ var float64Tag = "[object Float64Array]";
2336
+ var int8Tag = "[object Int8Array]";
2337
+ var int16Tag = "[object Int16Array]";
2338
+ var int32Tag = "[object Int32Array]";
2339
+ var uint8Tag = "[object Uint8Array]";
2340
+ var uint8ClampedTag = "[object Uint8ClampedArray]";
2341
+ var uint16Tag = "[object Uint16Array]";
2342
+ var uint32Tag = "[object Uint32Array]";
2343
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
2344
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
2345
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
2346
+ var typedArrayTags = {};
2347
+ typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
2348
+ 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;
2349
+ var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
2350
+ var freeSelf = typeof self == "object" && self && self.Object === Object && self;
2351
+ var root = freeGlobal || freeSelf || Function("return this")();
2352
+ var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
2353
+ var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
2354
+ var moduleExports = freeModule && freeModule.exports === freeExports;
2355
+ var freeProcess = moduleExports && freeGlobal.process;
2356
+ var nodeUtil = function() {
2357
+ try {
2358
+ return freeProcess && freeProcess.binding && freeProcess.binding("util");
2359
+ } catch (e) {
2360
+ }
2361
+ }();
2362
+ var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
2363
+ function arrayFilter(array, predicate) {
2364
+ var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
2365
+ while (++index < length) {
2366
+ var value = array[index];
2367
+ if (predicate(value, index, array)) {
2368
+ result[resIndex++] = value;
2369
+ }
2370
+ }
2371
+ return result;
2372
+ }
2373
+ function arrayPush(array, values) {
2374
+ var index = -1, length = values.length, offset = array.length;
2375
+ while (++index < length) {
2376
+ array[offset + index] = values[index];
2377
+ }
2378
+ return array;
2379
+ }
2380
+ function arraySome(array, predicate) {
2381
+ var index = -1, length = array == null ? 0 : array.length;
2382
+ while (++index < length) {
2383
+ if (predicate(array[index], index, array)) {
2384
+ return true;
2385
+ }
2386
+ }
2387
+ return false;
2388
+ }
2389
+ function baseTimes(n, iteratee) {
2390
+ var index = -1, result = Array(n);
2391
+ while (++index < n) {
2392
+ result[index] = iteratee(index);
2393
+ }
2394
+ return result;
2395
+ }
2396
+ function baseUnary(func) {
2397
+ return function(value) {
2398
+ return func(value);
2399
+ };
2400
+ }
2401
+ function cacheHas(cache, key) {
2402
+ return cache.has(key);
2403
+ }
2404
+ function getValue(object, key) {
2405
+ return object == null ? void 0 : object[key];
2406
+ }
2407
+ function mapToArray(map) {
2408
+ var index = -1, result = Array(map.size);
2409
+ map.forEach(function(value, key) {
2410
+ result[++index] = [key, value];
2411
+ });
2412
+ return result;
2413
+ }
2414
+ function overArg(func, transform) {
2415
+ return function(arg) {
2416
+ return func(transform(arg));
2417
+ };
2418
+ }
2419
+ function setToArray(set) {
2420
+ var index = -1, result = Array(set.size);
2421
+ set.forEach(function(value) {
2422
+ result[++index] = value;
2423
+ });
2424
+ return result;
2425
+ }
2426
+ var arrayProto = Array.prototype;
2427
+ var funcProto = Function.prototype;
2428
+ var objectProto = Object.prototype;
2429
+ var coreJsData = root["__core-js_shared__"];
2430
+ var funcToString = funcProto.toString;
2431
+ var hasOwnProperty = objectProto.hasOwnProperty;
2432
+ var maskSrcKey = function() {
2433
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
2434
+ return uid ? "Symbol(src)_1." + uid : "";
2435
+ }();
2436
+ var nativeObjectToString = objectProto.toString;
2437
+ var reIsNative = RegExp(
2438
+ "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
2439
+ );
2440
+ var Buffer2 = moduleExports ? root.Buffer : void 0;
2441
+ var Symbol2 = root.Symbol;
2442
+ var Uint8Array2 = root.Uint8Array;
2443
+ var propertyIsEnumerable = objectProto.propertyIsEnumerable;
2444
+ var splice = arrayProto.splice;
2445
+ var symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0;
2446
+ var nativeGetSymbols = Object.getOwnPropertySymbols;
2447
+ var nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0;
2448
+ var nativeKeys = overArg(Object.keys, Object);
2449
+ var DataView = getNative(root, "DataView");
2450
+ var Map2 = getNative(root, "Map");
2451
+ var Promise2 = getNative(root, "Promise");
2452
+ var Set2 = getNative(root, "Set");
2453
+ var WeakMap2 = getNative(root, "WeakMap");
2454
+ var nativeCreate = getNative(Object, "create");
2455
+ var dataViewCtorString = toSource(DataView);
2456
+ var mapCtorString = toSource(Map2);
2457
+ var promiseCtorString = toSource(Promise2);
2458
+ var setCtorString = toSource(Set2);
2459
+ var weakMapCtorString = toSource(WeakMap2);
2460
+ var symbolProto = Symbol2 ? Symbol2.prototype : void 0;
2461
+ var symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
2462
+ function Hash(entries) {
2463
+ var index = -1, length = entries == null ? 0 : entries.length;
2464
+ this.clear();
2465
+ while (++index < length) {
2466
+ var entry = entries[index];
2467
+ this.set(entry[0], entry[1]);
2468
+ }
2469
+ }
2470
+ function hashClear() {
2471
+ this.__data__ = nativeCreate ? nativeCreate(null) : {};
2472
+ this.size = 0;
2473
+ }
2474
+ function hashDelete(key) {
2475
+ var result = this.has(key) && delete this.__data__[key];
2476
+ this.size -= result ? 1 : 0;
2477
+ return result;
2478
+ }
2479
+ function hashGet(key) {
2480
+ var data = this.__data__;
2481
+ if (nativeCreate) {
2482
+ var result = data[key];
2483
+ return result === HASH_UNDEFINED ? void 0 : result;
2484
+ }
2485
+ return hasOwnProperty.call(data, key) ? data[key] : void 0;
2486
+ }
2487
+ function hashHas(key) {
2488
+ var data = this.__data__;
2489
+ return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
2490
+ }
2491
+ function hashSet(key, value) {
2492
+ var data = this.__data__;
2493
+ this.size += this.has(key) ? 0 : 1;
2494
+ data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
2495
+ return this;
2496
+ }
2497
+ Hash.prototype.clear = hashClear;
2498
+ Hash.prototype["delete"] = hashDelete;
2499
+ Hash.prototype.get = hashGet;
2500
+ Hash.prototype.has = hashHas;
2501
+ Hash.prototype.set = hashSet;
2502
+ function ListCache(entries) {
2503
+ var index = -1, length = entries == null ? 0 : entries.length;
2504
+ this.clear();
2505
+ while (++index < length) {
2506
+ var entry = entries[index];
2507
+ this.set(entry[0], entry[1]);
2508
+ }
2509
+ }
2510
+ function listCacheClear() {
2511
+ this.__data__ = [];
2512
+ this.size = 0;
2513
+ }
2514
+ function listCacheDelete(key) {
2515
+ var data = this.__data__, index = assocIndexOf(data, key);
2516
+ if (index < 0) {
2517
+ return false;
2518
+ }
2519
+ var lastIndex = data.length - 1;
2520
+ if (index == lastIndex) {
2521
+ data.pop();
2522
+ } else {
2523
+ splice.call(data, index, 1);
2524
+ }
2525
+ --this.size;
2526
+ return true;
2527
+ }
2528
+ function listCacheGet(key) {
2529
+ var data = this.__data__, index = assocIndexOf(data, key);
2530
+ return index < 0 ? void 0 : data[index][1];
2531
+ }
2532
+ function listCacheHas(key) {
2533
+ return assocIndexOf(this.__data__, key) > -1;
2534
+ }
2535
+ function listCacheSet(key, value) {
2536
+ var data = this.__data__, index = assocIndexOf(data, key);
2537
+ if (index < 0) {
2538
+ ++this.size;
2539
+ data.push([key, value]);
2540
+ } else {
2541
+ data[index][1] = value;
2542
+ }
2543
+ return this;
2544
+ }
2545
+ ListCache.prototype.clear = listCacheClear;
2546
+ ListCache.prototype["delete"] = listCacheDelete;
2547
+ ListCache.prototype.get = listCacheGet;
2548
+ ListCache.prototype.has = listCacheHas;
2549
+ ListCache.prototype.set = listCacheSet;
2550
+ function MapCache(entries) {
2551
+ var index = -1, length = entries == null ? 0 : entries.length;
2552
+ this.clear();
2553
+ while (++index < length) {
2554
+ var entry = entries[index];
2555
+ this.set(entry[0], entry[1]);
2556
+ }
2557
+ }
2558
+ function mapCacheClear() {
2559
+ this.size = 0;
2560
+ this.__data__ = {
2561
+ "hash": new Hash(),
2562
+ "map": new (Map2 || ListCache)(),
2563
+ "string": new Hash()
2564
+ };
2565
+ }
2566
+ function mapCacheDelete(key) {
2567
+ var result = getMapData(this, key)["delete"](key);
2568
+ this.size -= result ? 1 : 0;
2569
+ return result;
2570
+ }
2571
+ function mapCacheGet(key) {
2572
+ return getMapData(this, key).get(key);
2573
+ }
2574
+ function mapCacheHas(key) {
2575
+ return getMapData(this, key).has(key);
2576
+ }
2577
+ function mapCacheSet(key, value) {
2578
+ var data = getMapData(this, key), size = data.size;
2579
+ data.set(key, value);
2580
+ this.size += data.size == size ? 0 : 1;
2581
+ return this;
2582
+ }
2583
+ MapCache.prototype.clear = mapCacheClear;
2584
+ MapCache.prototype["delete"] = mapCacheDelete;
2585
+ MapCache.prototype.get = mapCacheGet;
2586
+ MapCache.prototype.has = mapCacheHas;
2587
+ MapCache.prototype.set = mapCacheSet;
2588
+ function SetCache(values) {
2589
+ var index = -1, length = values == null ? 0 : values.length;
2590
+ this.__data__ = new MapCache();
2591
+ while (++index < length) {
2592
+ this.add(values[index]);
2593
+ }
2594
+ }
2595
+ function setCacheAdd(value) {
2596
+ this.__data__.set(value, HASH_UNDEFINED);
2597
+ return this;
2598
+ }
2599
+ function setCacheHas(value) {
2600
+ return this.__data__.has(value);
2601
+ }
2602
+ SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
2603
+ SetCache.prototype.has = setCacheHas;
2604
+ function Stack(entries) {
2605
+ var data = this.__data__ = new ListCache(entries);
2606
+ this.size = data.size;
2607
+ }
2608
+ function stackClear() {
2609
+ this.__data__ = new ListCache();
2610
+ this.size = 0;
2611
+ }
2612
+ function stackDelete(key) {
2613
+ var data = this.__data__, result = data["delete"](key);
2614
+ this.size = data.size;
2615
+ return result;
2616
+ }
2617
+ function stackGet(key) {
2618
+ return this.__data__.get(key);
2619
+ }
2620
+ function stackHas(key) {
2621
+ return this.__data__.has(key);
2622
+ }
2623
+ function stackSet(key, value) {
2624
+ var data = this.__data__;
2625
+ if (data instanceof ListCache) {
2626
+ var pairs = data.__data__;
2627
+ if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
2628
+ pairs.push([key, value]);
2629
+ this.size = ++data.size;
2630
+ return this;
2631
+ }
2632
+ data = this.__data__ = new MapCache(pairs);
2633
+ }
2634
+ data.set(key, value);
2635
+ this.size = data.size;
2636
+ return this;
2637
+ }
2638
+ Stack.prototype.clear = stackClear;
2639
+ Stack.prototype["delete"] = stackDelete;
2640
+ Stack.prototype.get = stackGet;
2641
+ Stack.prototype.has = stackHas;
2642
+ Stack.prototype.set = stackSet;
2643
+ function arrayLikeKeys(value, inherited) {
2644
+ 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;
2645
+ for (var key in value) {
2646
+ if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
2647
+ (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
2648
+ isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
2649
+ isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
2650
+ isIndex(key, length)))) {
2651
+ result.push(key);
2652
+ }
2653
+ }
2654
+ return result;
2655
+ }
2656
+ function assocIndexOf(array, key) {
2657
+ var length = array.length;
2658
+ while (length--) {
2659
+ if (eq(array[length][0], key)) {
2660
+ return length;
2661
+ }
2662
+ }
2663
+ return -1;
2664
+ }
2665
+ function baseGetAllKeys(object, keysFunc, symbolsFunc) {
2666
+ var result = keysFunc(object);
2667
+ return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
2668
+ }
2669
+ function baseGetTag(value) {
2670
+ if (value == null) {
2671
+ return value === void 0 ? undefinedTag : nullTag;
2672
+ }
2673
+ return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
2674
+ }
2675
+ function baseIsArguments(value) {
2676
+ return isObjectLike(value) && baseGetTag(value) == argsTag;
2677
+ }
2678
+ function baseIsEqual(value, other, bitmask, customizer, stack) {
2679
+ if (value === other) {
2680
+ return true;
2681
+ }
2682
+ if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
2683
+ return value !== value && other !== other;
2684
+ }
2685
+ return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
2686
+ }
2687
+ function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
2688
+ var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other);
2689
+ objTag = objTag == argsTag ? objectTag : objTag;
2690
+ othTag = othTag == argsTag ? objectTag : othTag;
2691
+ var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
2692
+ if (isSameTag && isBuffer(object)) {
2693
+ if (!isBuffer(other)) {
2694
+ return false;
2695
+ }
2696
+ objIsArr = true;
2697
+ objIsObj = false;
2698
+ }
2699
+ if (isSameTag && !objIsObj) {
2700
+ stack || (stack = new Stack());
2701
+ return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
2702
+ }
2703
+ if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
2704
+ var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
2705
+ if (objIsWrapped || othIsWrapped) {
2706
+ var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
2707
+ stack || (stack = new Stack());
2708
+ return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
2709
+ }
2710
+ }
2711
+ if (!isSameTag) {
2712
+ return false;
2713
+ }
2714
+ stack || (stack = new Stack());
2715
+ return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
2716
+ }
2717
+ function baseIsNative(value) {
2718
+ if (!isObject(value) || isMasked(value)) {
2719
+ return false;
2720
+ }
2721
+ var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
2722
+ return pattern.test(toSource(value));
2723
+ }
2724
+ function baseIsTypedArray(value) {
2725
+ return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
2726
+ }
2727
+ function baseKeys(object) {
2728
+ if (!isPrototype(object)) {
2729
+ return nativeKeys(object);
2730
+ }
2731
+ var result = [];
2732
+ for (var key in Object(object)) {
2733
+ if (hasOwnProperty.call(object, key) && key != "constructor") {
2734
+ result.push(key);
2735
+ }
2736
+ }
2737
+ return result;
2738
+ }
2739
+ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
2740
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length;
2741
+ if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
2742
+ return false;
2743
+ }
2744
+ var stacked = stack.get(array);
2745
+ if (stacked && stack.get(other)) {
2746
+ return stacked == other;
2747
+ }
2748
+ var index = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : void 0;
2749
+ stack.set(array, other);
2750
+ stack.set(other, array);
2751
+ while (++index < arrLength) {
2752
+ var arrValue = array[index], othValue = other[index];
2753
+ if (customizer) {
2754
+ var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
2755
+ }
2756
+ if (compared !== void 0) {
2757
+ if (compared) {
2758
+ continue;
2759
+ }
2760
+ result = false;
2761
+ break;
2762
+ }
2763
+ if (seen) {
2764
+ if (!arraySome(other, function(othValue2, othIndex) {
2765
+ if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
2766
+ return seen.push(othIndex);
2767
+ }
2768
+ })) {
2769
+ result = false;
2770
+ break;
2771
+ }
2772
+ } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
2773
+ result = false;
2774
+ break;
2775
+ }
2776
+ }
2777
+ stack["delete"](array);
2778
+ stack["delete"](other);
2779
+ return result;
2780
+ }
2781
+ function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
2782
+ switch (tag) {
2783
+ case dataViewTag:
2784
+ if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
2785
+ return false;
2786
+ }
2787
+ object = object.buffer;
2788
+ other = other.buffer;
2789
+ case arrayBufferTag:
2790
+ if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) {
2791
+ return false;
2792
+ }
2793
+ return true;
2794
+ case boolTag:
2795
+ case dateTag:
2796
+ case numberTag:
2797
+ return eq(+object, +other);
2798
+ case errorTag:
2799
+ return object.name == other.name && object.message == other.message;
2800
+ case regexpTag:
2801
+ case stringTag:
2802
+ return object == other + "";
2803
+ case mapTag:
2804
+ var convert = mapToArray;
2805
+ case setTag:
2806
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
2807
+ convert || (convert = setToArray);
2808
+ if (object.size != other.size && !isPartial) {
2809
+ return false;
2810
+ }
2811
+ var stacked = stack.get(object);
2812
+ if (stacked) {
2813
+ return stacked == other;
2814
+ }
2815
+ bitmask |= COMPARE_UNORDERED_FLAG;
2816
+ stack.set(object, other);
2817
+ var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
2818
+ stack["delete"](object);
2819
+ return result;
2820
+ case symbolTag:
2821
+ if (symbolValueOf) {
2822
+ return symbolValueOf.call(object) == symbolValueOf.call(other);
2823
+ }
2824
+ }
2825
+ return false;
2826
+ }
2827
+ function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
2828
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
2829
+ if (objLength != othLength && !isPartial) {
2830
+ return false;
2831
+ }
2832
+ var index = objLength;
2833
+ while (index--) {
2834
+ var key = objProps[index];
2835
+ if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
2836
+ return false;
2837
+ }
2838
+ }
2839
+ var stacked = stack.get(object);
2840
+ if (stacked && stack.get(other)) {
2841
+ return stacked == other;
2842
+ }
2843
+ var result = true;
2844
+ stack.set(object, other);
2845
+ stack.set(other, object);
2846
+ var skipCtor = isPartial;
2847
+ while (++index < objLength) {
2848
+ key = objProps[index];
2849
+ var objValue = object[key], othValue = other[key];
2850
+ if (customizer) {
2851
+ var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
2852
+ }
2853
+ if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
2854
+ result = false;
2855
+ break;
2856
+ }
2857
+ skipCtor || (skipCtor = key == "constructor");
2858
+ }
2859
+ if (result && !skipCtor) {
2860
+ var objCtor = object.constructor, othCtor = other.constructor;
2861
+ if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
2862
+ result = false;
2863
+ }
2864
+ }
2865
+ stack["delete"](object);
2866
+ stack["delete"](other);
2867
+ return result;
2868
+ }
2869
+ function getAllKeys(object) {
2870
+ return baseGetAllKeys(object, keys, getSymbols);
2871
+ }
2872
+ function getMapData(map, key) {
2873
+ var data = map.__data__;
2874
+ return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
2875
+ }
2876
+ function getNative(object, key) {
2877
+ var value = getValue(object, key);
2878
+ return baseIsNative(value) ? value : void 0;
2879
+ }
2880
+ function getRawTag(value) {
2881
+ var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
2882
+ try {
2883
+ value[symToStringTag] = void 0;
2884
+ var unmasked = true;
2885
+ } catch (e) {
2886
+ }
2887
+ var result = nativeObjectToString.call(value);
2888
+ if (unmasked) {
2889
+ if (isOwn) {
2890
+ value[symToStringTag] = tag;
2891
+ } else {
2892
+ delete value[symToStringTag];
2893
+ }
2894
+ }
2895
+ return result;
2896
+ }
2897
+ var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
2898
+ if (object == null) {
2899
+ return [];
2900
+ }
2901
+ object = Object(object);
2902
+ return arrayFilter(nativeGetSymbols(object), function(symbol) {
2903
+ return propertyIsEnumerable.call(object, symbol);
2904
+ });
2905
+ };
2906
+ var getTag = baseGetTag;
2907
+ 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) {
2908
+ getTag = function(value) {
2909
+ var result = baseGetTag(value), Ctor = result == objectTag ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
2910
+ if (ctorString) {
2911
+ switch (ctorString) {
2912
+ case dataViewCtorString:
2913
+ return dataViewTag;
2914
+ case mapCtorString:
2915
+ return mapTag;
2916
+ case promiseCtorString:
2917
+ return promiseTag;
2918
+ case setCtorString:
2919
+ return setTag;
2920
+ case weakMapCtorString:
2921
+ return weakMapTag;
2922
+ }
2923
+ }
2924
+ return result;
2925
+ };
2926
+ }
2927
+ function isIndex(value, length) {
2928
+ length = length == null ? MAX_SAFE_INTEGER : length;
2929
+ return !!length && (typeof value == "number" || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
2930
+ }
2931
+ function isKeyable(value) {
2932
+ var type = typeof value;
2933
+ return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
2934
+ }
2935
+ function isMasked(func) {
2936
+ return !!maskSrcKey && maskSrcKey in func;
2937
+ }
2938
+ function isPrototype(value) {
2939
+ var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
2940
+ return value === proto;
2941
+ }
2942
+ function objectToString(value) {
2943
+ return nativeObjectToString.call(value);
2944
+ }
2945
+ function toSource(func) {
2946
+ if (func != null) {
2947
+ try {
2948
+ return funcToString.call(func);
2949
+ } catch (e) {
2950
+ }
2951
+ try {
2952
+ return func + "";
2953
+ } catch (e) {
2954
+ }
2955
+ }
2956
+ return "";
2957
+ }
2958
+ function eq(value, other) {
2959
+ return value === other || value !== value && other !== other;
2960
+ }
2961
+ var isArguments = baseIsArguments(/* @__PURE__ */ function() {
2962
+ return arguments;
2963
+ }()) ? baseIsArguments : function(value) {
2964
+ return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
2965
+ };
2966
+ var isArray = Array.isArray;
2967
+ function isArrayLike(value) {
2968
+ return value != null && isLength(value.length) && !isFunction(value);
2969
+ }
2970
+ var isBuffer = nativeIsBuffer || stubFalse;
2971
+ function isEqual2(value, other) {
2972
+ return baseIsEqual(value, other);
2973
+ }
2974
+ function isFunction(value) {
2975
+ if (!isObject(value)) {
2976
+ return false;
2977
+ }
2978
+ var tag = baseGetTag(value);
2979
+ return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
2980
+ }
2981
+ function isLength(value) {
2982
+ return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
2983
+ }
2984
+ function isObject(value) {
2985
+ var type = typeof value;
2986
+ return value != null && (type == "object" || type == "function");
2987
+ }
2988
+ function isObjectLike(value) {
2989
+ return value != null && typeof value == "object";
2990
+ }
2991
+ var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
2992
+ function keys(object) {
2993
+ return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
79
2994
  }
80
- };
81
- const warn = (message) => {
82
- if (message && spinner) {
83
- spinner.warn(pc3.yellow(message));
84
- logs.push(message);
2995
+ function stubArray() {
2996
+ return [];
85
2997
  }
86
- };
87
- const info = (message) => {
88
- if (message && spinner && logLevel !== LogLevel.silent) {
89
- spinner.info(message);
90
- logs.push(message);
2998
+ function stubFalse() {
2999
+ return false;
91
3000
  }
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";
3001
+ module.exports = isEqual2;
109
3002
  }
110
- const random = seedrandom(text);
111
- const colour = colours.at(Math.floor(random() * colours.length)) || "white";
112
- return colour;
3003
+ });
3004
+
3005
+ // src/index.ts
3006
+ init_esm_shims();
3007
+
3008
+ // src/build.ts
3009
+ init_esm_shims();
3010
+
3011
+ // src/fs/clean.ts
3012
+ init_esm_shims();
3013
+ var import_fs_extra = __toESM(require_lib(), 1);
3014
+ async function clean(path5) {
3015
+ return (0, import_fs_extra.remove)(path5);
113
3016
  }
114
- function randomPicoColour(text, colors = defaultColours) {
115
- const colours = pc3.createColors(true);
116
- if (!text) {
117
- return colours.white(text);
3017
+
3018
+ // src/fs/read.ts
3019
+ init_esm_shims();
3020
+ var import_fs_extra2 = __toESM(require_lib(), 1);
3021
+ function slash(path5, platform = "linux") {
3022
+ const isWindowsPath = /^\\\\\?\\/.test(path5);
3023
+ if (["linux", "mac"].includes(platform) && !isWindowsPath) {
3024
+ return path5.replaceAll(/\\/g, "/").replace("../", "").trimEnd();
118
3025
  }
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));
3026
+ return path5.replaceAll(/\\/g, "/").replace("../", "").trimEnd();
3027
+ }
3028
+ function getRelativePath(rootDir, filePath, platform = "linux") {
3029
+ if (!rootDir || !filePath) {
3030
+ throw new Error(`Root and file should be filled in when retrieving the relativePath, ${rootDir || ""} ${filePath || ""}`);
125
3031
  }
126
- if (typeof formatter !== "function") {
127
- throw new Error("Formatter for picoColor is not of type function/Formatter");
3032
+ const relativePath = relative(rootDir, filePath);
3033
+ const slashedPath = slash(relativePath, platform);
3034
+ if (slashedPath.startsWith("../")) {
3035
+ return slashedPath.replace(basename(slashedPath), basename(slashedPath, extname(filePath)));
128
3036
  }
129
- return formatter(text);
3037
+ return `./${slashedPath.replace(basename(slashedPath), basename(slashedPath, extname(filePath)))}`;
130
3038
  }
131
3039
  var reader = switcher(
132
3040
  {
133
- node: async (path3) => {
134
- return fs2.readFile(path3, { encoding: "utf8" });
3041
+ node: async (path5) => {
3042
+ return import_fs_extra2.default.readFile(path5, { encoding: "utf8" });
135
3043
  },
136
- bun: async (path3) => {
137
- const file = Bun.file(path3);
3044
+ bun: async (path5) => {
3045
+ const file = Bun.file(path5);
138
3046
  return file.text();
139
3047
  }
140
3048
  },
@@ -142,8 +3050,8 @@ var reader = switcher(
142
3050
  );
143
3051
  switcher(
144
3052
  {
145
- node: (path3) => {
146
- return fs2.readFileSync(path3, { encoding: "utf8" });
3053
+ node: (path5) => {
3054
+ return import_fs_extra2.default.readFileSync(path5, { encoding: "utf8" });
147
3055
  },
148
3056
  bun: () => {
149
3057
  throw new Error("Bun cannot read sync");
@@ -151,144 +3059,45 @@ switcher(
151
3059
  },
152
3060
  "node"
153
3061
  );
154
- async function read(path3) {
155
- return reader(path3);
3062
+ async function read(path5) {
3063
+ return reader(path5);
156
3064
  }
157
- var URLPath = class {
158
- constructor(path3) {
159
- this.path = path3;
160
- return this;
161
- }
162
- /**
163
- * Convert Swagger path to URLPath(syntax of Express)
164
- * @example /pet/{petId} => /pet/:petId
165
- */
166
- get URL() {
167
- return this.toURLPath();
168
- }
169
- get isURL() {
170
- try {
171
- const url = new URL(this.path);
172
- if (url?.href) {
173
- return true;
174
- }
175
- } catch (error) {
176
- return false;
177
- }
178
- return false;
179
- }
180
- /**
181
- * Convert Swagger path to template literals/ template strings(camelcase)
182
- * @example /pet/{petId} => `/pet/${petId}`
183
- * @example /account/monetary-accountID => `/account/${monetaryAccountId}`
184
- * @example /account/userID => `/account/${userId}`
185
- */
186
- get template() {
187
- return this.toTemplateString();
188
- }
189
- get object() {
190
- return this.toObject();
191
- }
192
- get params() {
193
- return this.getParams();
194
- }
195
- toObject({ type = "path", replacer, stringify } = {}) {
196
- const object = {
197
- url: type === "path" ? this.toURLPath() : this.toTemplateString(replacer),
198
- params: this.getParams()
199
- };
200
- if (stringify) {
201
- if (type === "template") {
202
- return JSON.stringify(object).replaceAll("'", "").replaceAll(`"`, "");
203
- }
204
- if (object.params) {
205
- return `{ url: '${object.url}', params: ${JSON.stringify(object.params).replaceAll("'", "").replaceAll(`"`, "")} }`;
206
- }
207
- return `{ url: '${object.url}' }`;
208
- }
209
- return object;
210
- }
211
- /**
212
- * Convert Swagger path to template literals/ template strings(camelcase)
213
- * @example /pet/{petId} => `/pet/${petId}`
214
- * @example /account/monetary-accountID => `/account/${monetaryAccountId}`
215
- * @example /account/userID => `/account/${userId}`
216
- */
217
- toTemplateString(replacer) {
218
- const regex = /{(\w|-)*}/g;
219
- const found = this.path.match(regex);
220
- let newPath = this.path.replaceAll("{", "${");
221
- if (found) {
222
- newPath = found.reduce((prev, curr) => {
223
- const pathParam = replacer ? replacer(camelCase(curr, { delimiter: "", transform: camelCaseTransformMerge })) : camelCase(curr, { delimiter: "", transform: camelCaseTransformMerge });
224
- const replacement = `\${${pathParam}}`;
225
- return prev.replace(curr, replacement);
226
- }, this.path);
227
- }
228
- return `\`${newPath}\``;
229
- }
230
- getParams(replacer) {
231
- const regex = /{(\w|-)*}/g;
232
- const found = this.path.match(regex);
233
- if (!found) {
234
- return void 0;
235
- }
236
- const params = {};
237
- found.forEach((item) => {
238
- item = item.replaceAll("{", "").replaceAll("}", "");
239
- const pathParam = replacer ? replacer(camelCase(item, { delimiter: "", transform: camelCaseTransformMerge })) : camelCase(item, { delimiter: "", transform: camelCaseTransformMerge });
240
- params[pathParam] = pathParam;
241
- }, this.path);
242
- return params;
243
- }
244
- /**
245
- * Convert Swagger path to URLPath(syntax of Express)
246
- * @example /pet/{petId} => /pet/:petId
247
- */
248
- toURLPath() {
249
- return this.path.replaceAll("{", ":").replaceAll("}", "");
250
- }
251
- };
252
3065
 
253
- // src/config.ts
254
- function defineConfig(options) {
255
- return options;
256
- }
257
- function isInputPath(result) {
258
- return !!result && "path" in result;
259
- }
3066
+ // src/utils/URLPath.ts
3067
+ init_esm_shims();
260
3068
 
261
- // src/utils/timeout.ts
262
- async function timeout(ms) {
263
- return new Promise((resolve2) => {
264
- setTimeout(() => {
265
- resolve2(true);
266
- }, ms);
267
- });
3069
+ // src/transformers/index.ts
3070
+ init_esm_shims();
3071
+
3072
+ // src/transformers/casing.ts
3073
+ init_esm_shims();
3074
+ function camelCase(text) {
3075
+ return camelCase$1(text, { delimiter: "", stripRegexp: /[^A-Z0-9$]/gi, transform: camelCaseTransformMerge });
3076
+ }
3077
+ function pascalCase(text) {
3078
+ return pascalCase$1(text, { delimiter: "", stripRegexp: /[^A-Z0-9$]/gi, transform: pascalCaseTransformMerge });
268
3079
  }
269
3080
 
270
- // src/utils/transformers/combineCodes.ts
3081
+ // src/transformers/combineCodes.ts
3082
+ init_esm_shims();
271
3083
  function combineCodes(codes) {
272
3084
  return codes.join("\n");
273
3085
  }
274
3086
 
275
- // src/utils/transformers/createJSDocBlockText.ts
276
- function createJSDocBlockText({ comments, newLine }) {
3087
+ // src/transformers/createJSDocBlockText.ts
3088
+ init_esm_shims();
3089
+ function createJSDocBlockText({ comments }) {
277
3090
  const filteredComments = comments.filter(Boolean);
278
3091
  if (!filteredComments.length) {
279
3092
  return "";
280
3093
  }
281
- const source = `/**
3094
+ return `/**
282
3095
  * ${filteredComments.join("\n * ")}
283
3096
  */`;
284
- if (newLine) {
285
- return `${source}
286
- `;
287
- }
288
- return source;
289
3097
  }
290
3098
 
291
- // src/utils/transformers/escape.ts
3099
+ // src/transformers/escape.ts
3100
+ init_esm_shims();
292
3101
  function escape(text) {
293
3102
  return text ? text.replaceAll("`", "\\`") : "";
294
3103
  }
@@ -313,12 +3122,14 @@ function jsStringEscape(input) {
313
3122
  });
314
3123
  }
315
3124
 
316
- // src/utils/transformers/indent.ts
3125
+ // src/transformers/indent.ts
3126
+ init_esm_shims();
317
3127
  function createIndent(size) {
318
3128
  return Array.from({ length: size + 1 }).join(" ");
319
3129
  }
320
3130
 
321
- // src/utils/transformers/nameSorter.ts
3131
+ // src/transformers/nameSorter.ts
3132
+ init_esm_shims();
322
3133
  function nameSorter(a, b) {
323
3134
  if (a.name < b.name) {
324
3135
  return -1;
@@ -329,7 +3140,8 @@ function nameSorter(a, b) {
329
3140
  return 0;
330
3141
  }
331
3142
 
332
- // src/utils/transformers/searchAndReplace.ts
3143
+ // src/transformers/searchAndReplace.ts
3144
+ init_esm_shims();
333
3145
  function searchAndReplace(options) {
334
3146
  const { text, replaceBy, prefix = "", key } = options;
335
3147
  const searchValues = options.searchValues?.(prefix, key) || [
@@ -346,7 +3158,8 @@ function searchAndReplace(options) {
346
3158
  }, text);
347
3159
  }
348
3160
 
349
- // src/utils/transformers/transformReservedWord.ts
3161
+ // src/transformers/transformReservedWord.ts
3162
+ init_esm_shims();
350
3163
  var reservedWords = [
351
3164
  "abstract",
352
3165
  "arguments",
@@ -436,48 +3249,169 @@ function transformReservedWord(word) {
436
3249
  if (word && reservedWords.includes(word) || word?.match(/^\d/)) {
437
3250
  return `_${word}`;
438
3251
  }
439
- return word;
440
- }
3252
+ return word;
3253
+ }
3254
+
3255
+ // src/transformers/trim.ts
3256
+ init_esm_shims();
3257
+ function trim(text) {
3258
+ return text.replaceAll(/\n/g, "").trim();
3259
+ }
3260
+ function trimExtName(text) {
3261
+ return text.replace(/\.[^/.]+$/, "");
3262
+ }
3263
+
3264
+ // src/transformers/index.ts
3265
+ var transformers_default = {
3266
+ combineCodes,
3267
+ escape,
3268
+ jsStringEscape,
3269
+ createIndent,
3270
+ transformReservedWord,
3271
+ nameSorter,
3272
+ searchAndReplace,
3273
+ trim,
3274
+ trimExtName,
3275
+ JSDoc: {
3276
+ createJSDocBlockText
3277
+ },
3278
+ camelCase,
3279
+ pascalCase
3280
+ };
3281
+
3282
+ // src/utils/URLPath.ts
3283
+ var URLPath = class {
3284
+ constructor(path5) {
3285
+ this.path = path5;
3286
+ return this;
3287
+ }
3288
+ /**
3289
+ * Convert Swagger path to URLPath(syntax of Express)
3290
+ * @example /pet/{petId} => /pet/:petId
3291
+ */
3292
+ get URL() {
3293
+ return this.toURLPath();
3294
+ }
3295
+ get isURL() {
3296
+ try {
3297
+ const url = new URL(this.path);
3298
+ if (url?.href) {
3299
+ return true;
3300
+ }
3301
+ } catch (error) {
3302
+ return false;
3303
+ }
3304
+ return false;
3305
+ }
3306
+ /**
3307
+ * Convert Swagger path to template literals/ template strings(camelcase)
3308
+ * @example /pet/{petId} => `/pet/${petId}`
3309
+ * @example /account/monetary-accountID => `/account/${monetaryAccountId}`
3310
+ * @example /account/userID => `/account/${userId}`
3311
+ */
3312
+ get template() {
3313
+ return this.toTemplateString();
3314
+ }
3315
+ get object() {
3316
+ return this.toObject();
3317
+ }
3318
+ get params() {
3319
+ return this.getParams();
3320
+ }
3321
+ toObject({ type = "path", replacer, stringify } = {}) {
3322
+ const object = {
3323
+ url: type === "path" ? this.toURLPath() : this.toTemplateString(replacer),
3324
+ params: this.getParams()
3325
+ };
3326
+ if (stringify) {
3327
+ if (type === "template") {
3328
+ return JSON.stringify(object).replaceAll("'", "").replaceAll(`"`, "");
3329
+ }
3330
+ if (object.params) {
3331
+ return `{ url: '${object.url}', params: ${JSON.stringify(object.params).replaceAll("'", "").replaceAll(`"`, "")} }`;
3332
+ }
3333
+ return `{ url: '${object.url}' }`;
3334
+ }
3335
+ return object;
3336
+ }
3337
+ /**
3338
+ * Convert Swagger path to template literals/ template strings(camelcase)
3339
+ * @example /pet/{petId} => `/pet/${petId}`
3340
+ * @example /account/monetary-accountID => `/account/${monetaryAccountId}`
3341
+ * @example /account/userID => `/account/${userId}`
3342
+ */
3343
+ toTemplateString(replacer) {
3344
+ const regex = /{(\w|-)*}/g;
3345
+ const found = this.path.match(regex);
3346
+ let newPath = this.path.replaceAll("{", "${");
3347
+ if (found) {
3348
+ newPath = found.reduce((prev, curr) => {
3349
+ const pathParam = replacer ? replacer(transformers_default.camelCase(curr)) : transformers_default.camelCase(curr);
3350
+ const replacement = `\${${pathParam}}`;
3351
+ return prev.replace(curr, replacement);
3352
+ }, this.path);
3353
+ }
3354
+ return `\`${newPath}\``;
3355
+ }
3356
+ getParams(replacer) {
3357
+ const regex = /{(\w|-)*}/g;
3358
+ const found = this.path.match(regex);
3359
+ if (!found) {
3360
+ return void 0;
3361
+ }
3362
+ const params = {};
3363
+ found.forEach((item) => {
3364
+ item = item.replaceAll("{", "").replaceAll("}", "");
3365
+ const pathParam = replacer ? replacer(transformers_default.camelCase(item)) : transformers_default.camelCase(item);
3366
+ params[pathParam] = pathParam;
3367
+ }, this.path);
3368
+ return params;
3369
+ }
3370
+ /**
3371
+ * Convert Swagger path to URLPath(syntax of Express)
3372
+ * @example /pet/{petId} => /pet/:petId
3373
+ */
3374
+ toURLPath() {
3375
+ return this.path.replaceAll("{", ":").replaceAll("}", "");
3376
+ }
3377
+ };
441
3378
 
442
- // src/utils/transformers/trim.ts
443
- function trim(text) {
444
- return text.replaceAll(/\n/g, "").trim();
3379
+ // src/config.ts
3380
+ init_esm_shims();
3381
+ function defineConfig(options) {
3382
+ return options;
3383
+ }
3384
+ function isInputPath(result) {
3385
+ return !!result && "path" in result;
445
3386
  }
446
3387
 
447
- // src/utils/transformers/index.ts
448
- var transformers = {
449
- combineCodes,
450
- escape,
451
- jsStringEscape,
452
- createIndent,
453
- transformReservedWord,
454
- nameSorter,
455
- searchAndReplace,
456
- trim,
457
- JSDoc: {
458
- createJSDocBlockText
459
- }
460
- };
461
- async function saveCreateDirectory(path3) {
462
- const passedPath = dirname(resolve(path3));
463
- await fs2.mkdir(passedPath, { recursive: true });
3388
+ // src/FileManager.ts
3389
+ init_esm_shims();
3390
+ var import_lodash = __toESM(require_lodash(), 1);
3391
+
3392
+ // src/fs/write.ts
3393
+ init_esm_shims();
3394
+ var import_fs_extra3 = __toESM(require_lib(), 1);
3395
+ async function saveCreateDirectory(path5) {
3396
+ const passedPath = dirname(resolve(path5));
3397
+ await import_fs_extra3.default.mkdir(passedPath, { recursive: true });
464
3398
  }
465
3399
  var writer = switcher(
466
3400
  {
467
- node: async (path3, data) => {
3401
+ node: async (path5, data) => {
468
3402
  try {
469
- await fs2.stat(resolve(path3));
470
- const oldContent = await fs2.readFile(resolve(path3), { encoding: "utf-8" });
3403
+ await import_fs_extra3.default.stat(resolve(path5));
3404
+ const oldContent = await import_fs_extra3.default.readFile(resolve(path5), { encoding: "utf-8" });
471
3405
  if (oldContent?.toString() === data?.toString()) {
472
3406
  return;
473
3407
  }
474
3408
  } catch (_err) {
475
3409
  }
476
- await saveCreateDirectory(path3);
477
- await fs2.writeFile(resolve(path3), data, { encoding: "utf-8" });
478
- const savedData = await fs2.readFile(resolve(path3), { encoding: "utf-8" });
3410
+ await saveCreateDirectory(path5);
3411
+ await import_fs_extra3.default.writeFile(resolve(path5), data, { encoding: "utf-8" });
3412
+ const savedData = await import_fs_extra3.default.readFile(resolve(path5), { encoding: "utf-8" });
479
3413
  if (savedData?.toString() !== data?.toString()) {
480
- throw new Error(`Sanity check failed for ${path3}
3414
+ throw new Error(`Sanity check failed for ${path5}
481
3415
 
482
3416
  Data[${data.length}]:
483
3417
  ${data}
@@ -488,14 +3422,14 @@ ${savedData}
488
3422
  }
489
3423
  return savedData;
490
3424
  },
491
- bun: async (path3, data) => {
3425
+ bun: async (path5, data) => {
492
3426
  try {
493
- await saveCreateDirectory(path3);
494
- await Bun.write(resolve(path3), data);
495
- const file = Bun.file(resolve(path3));
3427
+ await saveCreateDirectory(path5);
3428
+ await Bun.write(resolve(path5), data);
3429
+ const file = Bun.file(resolve(path5));
496
3430
  const savedData = await file.text();
497
3431
  if (savedData?.toString() !== data?.toString()) {
498
- throw new Error(`Sanity check failed for ${path3}
3432
+ throw new Error(`Sanity check failed for ${path5}
499
3433
 
500
3434
  Data[${data.length}]:
501
3435
  ${data}
@@ -506,18 +3440,34 @@ ${savedData}
506
3440
  }
507
3441
  return savedData;
508
3442
  } catch (e) {
509
- console.log(e, resolve(path3));
3443
+ console.log(e, resolve(path5));
510
3444
  }
511
3445
  }
512
3446
  },
513
3447
  "node"
514
3448
  );
515
- async function write(data, path3) {
3449
+ async function write(data, path5) {
516
3450
  if (data.trim() === "") {
517
3451
  return void 0;
518
3452
  }
519
- return writer(path3, data.trim());
3453
+ return writer(path5, data.trim());
3454
+ }
3455
+
3456
+ // src/utils/timeout.ts
3457
+ init_esm_shims();
3458
+ async function timeout(ms) {
3459
+ return new Promise((resolve3) => {
3460
+ setTimeout(() => {
3461
+ resolve3(true);
3462
+ }, ms);
3463
+ });
520
3464
  }
3465
+
3466
+ // src/BarrelManager.ts
3467
+ init_esm_shims();
3468
+
3469
+ // src/utils/TreeNode.ts
3470
+ init_esm_shims();
521
3471
  var TreeNode = class _TreeNode {
522
3472
  constructor(data, parent) {
523
3473
  this.children = [];
@@ -580,10 +3530,10 @@ var TreeNode = class _TreeNode {
580
3530
  }
581
3531
  return this;
582
3532
  }
583
- static build(path3, options = {}) {
3533
+ static build(path5, options = {}) {
584
3534
  try {
585
3535
  const exclude = Array.isArray(options.exclude) ? options.exclude : [options.exclude].filter(Boolean);
586
- const filteredTree = dirTree(path3, { extensions: options.extensions, exclude: [/node_modules/, ...exclude] });
3536
+ const filteredTree = dirTree(path5, { extensions: options.extensions, exclude: [/node_modules/, ...exclude] });
587
3537
  if (!filteredTree) {
588
3538
  return null;
589
3539
  }
@@ -608,78 +3558,67 @@ var TreeNode = class _TreeNode {
608
3558
  var _options;
609
3559
  var BarrelManager = class {
610
3560
  constructor(options = {}) {
611
- __privateAdd(this, _options, {});
3561
+ __privateAdd(this, _options, void 0);
612
3562
  __privateSet(this, _options, options);
613
3563
  return this;
614
3564
  }
615
- getIndexes(root, extName) {
616
- const { treeNode = {}, isTypeOnly, filter, map, output, includeExt } = __privateGet(this, _options);
617
- const extMapper = {
618
- ".ts": {
619
- extensions: /\.ts/,
620
- exclude: [/schemas/, /json/]
621
- },
622
- ".json": {
623
- extensions: /\.json/,
624
- exclude: []
625
- }
626
- };
627
- const tree = TreeNode.build(root, { ...extMapper[extName] || {}, ...treeNode });
3565
+ getIndexes(pathToBuild) {
3566
+ const { treeNode = {}, isTypeOnly, extName } = __privateGet(this, _options);
3567
+ const tree = TreeNode.build(pathToBuild, treeNode);
628
3568
  if (!tree) {
629
3569
  return null;
630
3570
  }
631
- const fileReducer = (files2, currentTree) => {
632
- if (!currentTree.children) {
3571
+ const fileReducer = (files, treeNode2) => {
3572
+ if (!treeNode2.children) {
633
3573
  return [];
634
3574
  }
635
- if (currentTree.children?.length > 1) {
636
- const indexPath = path.resolve(currentTree.data.path, "index.ts");
637
- const exports = currentTree.children.filter(Boolean).map((file) => {
638
- const importPath = file.data.type === "directory" ? `./${file.data.name}/index` : `./${file.data.name.replace(/\.[^.]*$/, "")}`;
639
- if (importPath.includes("index") && file.data.type === "file") {
3575
+ if (treeNode2.children.length > 1) {
3576
+ const indexPath = path4.resolve(treeNode2.data.path, "index.ts");
3577
+ const exports = treeNode2.children.filter(Boolean).map((file) => {
3578
+ const importPath = file.data.type === "directory" ? `./${file.data.name}/index` : `./${transformers_default.trimExtName(file.data.name)}`;
3579
+ if (importPath.endsWith("index") && file.data.type === "file") {
640
3580
  return void 0;
641
3581
  }
642
3582
  return {
643
- path: includeExt ? `${importPath}${extName}` : importPath,
3583
+ path: extName ? `${importPath}${extName}` : importPath,
644
3584
  isTypeOnly
645
3585
  };
646
3586
  }).filter(Boolean);
647
- files2.push({
3587
+ files.push({
648
3588
  path: indexPath,
649
3589
  baseName: "index.ts",
650
3590
  source: "",
651
- exports: output ? exports?.filter((item) => {
652
- return item.path.endsWith(output.replace(/\.[^.]*$/, ""));
653
- }) : exports
3591
+ exports,
3592
+ meta: {
3593
+ treeNode: treeNode2
3594
+ }
654
3595
  });
655
- } else {
656
- currentTree.children?.forEach((child) => {
657
- const indexPath = path.resolve(currentTree.data.path, "index.ts");
658
- const importPath = child.data.type === "directory" ? `./${child.data.name}/index` : `./${child.data.name.replace(/\.[^.]*$/, "")}`;
659
- const exports = [
660
- {
661
- path: includeExt ? `${importPath}${extName}` : importPath,
662
- isTypeOnly
663
- }
664
- ];
665
- files2.push({
666
- path: indexPath,
667
- baseName: "index.ts",
668
- source: "",
669
- exports: output ? exports?.filter((item) => {
670
- return item.path.endsWith(output.replace(/\.[^.]*$/, ""));
671
- }) : exports
672
- });
3596
+ } else if (treeNode2.children.length === 1) {
3597
+ const [treeNodeChild] = treeNode2.children;
3598
+ const indexPath = path4.resolve(treeNode2.data.path, "index.ts");
3599
+ const importPath = treeNodeChild.data.type === "directory" ? `./${treeNodeChild.data.name}/index` : `./${transformers_default.trimExtName(treeNodeChild.data.name)}`;
3600
+ const exports = [
3601
+ {
3602
+ path: extName ? `${importPath}${extName}` : importPath,
3603
+ isTypeOnly
3604
+ }
3605
+ ];
3606
+ files.push({
3607
+ path: indexPath,
3608
+ baseName: "index.ts",
3609
+ source: "",
3610
+ exports,
3611
+ meta: {
3612
+ treeNode: treeNode2
3613
+ }
673
3614
  });
674
3615
  }
675
- currentTree.children.forEach((childItem) => {
676
- fileReducer(files2, childItem);
3616
+ treeNode2.children.forEach((childItem) => {
3617
+ fileReducer(files, childItem);
677
3618
  });
678
- return files2;
3619
+ return files;
679
3620
  };
680
- const files = fileReducer([], tree).reverse();
681
- const filteredFiles = filter ? files.filter(filter) : files;
682
- return map ? filteredFiles.map(map) : filteredFiles;
3621
+ return fileReducer([], tree).reverse();
683
3622
  }
684
3623
  };
685
3624
  _options = new WeakMap();
@@ -688,7 +3627,7 @@ _options = new WeakMap();
688
3627
  var KubbFile;
689
3628
  ((KubbFile2) => {
690
3629
  })(KubbFile || (KubbFile = {}));
691
- var _cache, _task, _isWriting, _timeout, _queue, _validate, validate_fn, _add, add_fn, _addOrAppend, addOrAppend_fn;
3630
+ var _cache, _task, _isWriting, _timeout, _queue, _validate, _add, add_fn, _addOrAppend, addOrAppend_fn;
692
3631
  var _FileManager = class _FileManager {
693
3632
  constructor(options) {
694
3633
  __privateAdd(this, _validate);
@@ -721,7 +3660,6 @@ var _FileManager = class _FileManager {
721
3660
  }
722
3661
  async add(...files) {
723
3662
  const promises = files.map((file) => {
724
- __privateMethod(this, _validate, validate_fn).call(this, file);
725
3663
  if (file.override) {
726
3664
  return __privateMethod(this, _add, add_fn).call(this, file);
727
3665
  }
@@ -733,12 +3671,37 @@ var _FileManager = class _FileManager {
733
3671
  }
734
3672
  return resolvedFiles[0];
735
3673
  }
736
- async addIndexes({ root, extName = ".ts", meta, options = {} }) {
737
- const barrelManager = new BarrelManager(options);
738
- const files = barrelManager.getIndexes(root, extName);
3674
+ async addIndexes({ root, output, meta, options = {} }) {
3675
+ const { exportType = "barrel" } = output;
3676
+ if (!exportType) {
3677
+ return void 0;
3678
+ }
3679
+ const exportPath = output.path.startsWith("./") ? output.path : `./${output.path}`;
3680
+ const barrelManager = new BarrelManager({ extName: output.extName, ...options });
3681
+ const files = barrelManager.getIndexes(resolve(root, output.path));
739
3682
  if (!files) {
740
3683
  return void 0;
741
3684
  }
3685
+ const rootFile = {
3686
+ path: resolve(root, "index.ts"),
3687
+ baseName: "index.ts",
3688
+ source: "",
3689
+ exports: [
3690
+ output.exportAs ? {
3691
+ name: output.exportAs,
3692
+ asAlias: true,
3693
+ path: exportPath,
3694
+ isTypeOnly: options.isTypeOnly
3695
+ } : {
3696
+ path: exportPath,
3697
+ isTypeOnly: options.isTypeOnly
3698
+ }
3699
+ ]
3700
+ };
3701
+ await __privateMethod(this, _addOrAppend, addOrAppend_fn).call(this, {
3702
+ ...rootFile,
3703
+ meta: meta ? meta : rootFile.meta
3704
+ });
742
3705
  return await Promise.all(
743
3706
  files.map((file) => {
744
3707
  return __privateMethod(this, _addOrAppend, addOrAppend_fn).call(this, {
@@ -755,15 +3718,15 @@ var _FileManager = class _FileManager {
755
3718
  });
756
3719
  return cache;
757
3720
  }
758
- get(path3) {
759
- return __privateGet(this, _cache).get(path3);
3721
+ get(path5) {
3722
+ return __privateGet(this, _cache).get(path5);
760
3723
  }
761
- remove(path3) {
762
- const cacheItem = this.get(path3);
3724
+ remove(path5) {
3725
+ const cacheItem = this.get(path5);
763
3726
  if (!cacheItem) {
764
3727
  return;
765
3728
  }
766
- __privateGet(this, _cache).delete(path3);
3729
+ __privateGet(this, _cache).delete(path5);
767
3730
  }
768
3731
  async write(...params) {
769
3732
  if (!__privateGet(this, _isWriting)) {
@@ -780,50 +3743,13 @@ var _FileManager = class _FileManager {
780
3743
  }
781
3744
  // statics
782
3745
  static getSource(file) {
783
- if (!_FileManager.isExtensionAllowed(file.baseName)) {
784
- return file.source;
785
- }
786
- const exports = file.exports ? combineExports(file.exports) : [];
787
- const imports = file.imports ? combineImports(file.imports, exports, file.source) : [];
788
- const importNodes = imports.map((item) => factory.createImportDeclaration({ name: item.name, path: item.path, isTypeOnly: item.isTypeOnly }));
789
- const exportNodes = exports.map(
790
- (item) => factory.createExportDeclaration({ name: item.name, path: item.path, isTypeOnly: item.isTypeOnly, asAlias: item.asAlias })
791
- );
792
- return [print([...importNodes, ...exportNodes]), getEnvSource(file.source, file.env)].join("\n");
793
- }
794
- static combineFiles(files) {
795
- return files.filter(Boolean).reduce((acc, file) => {
796
- const prevIndex = acc.findIndex((item) => item.path === file.path);
797
- if (prevIndex === -1) {
798
- return [...acc, file];
799
- }
800
- const prev = acc[prevIndex];
801
- if (prev && file.override) {
802
- acc[prevIndex] = {
803
- imports: [],
804
- exports: [],
805
- ...file
806
- };
807
- return acc;
808
- }
809
- if (prev) {
810
- acc[prevIndex] = {
811
- ...file,
812
- source: prev.source && file.source ? `${prev.source}
813
- ${file.source}` : "",
814
- imports: [...prev.imports || [], ...file.imports || []],
815
- exports: [...prev.exports || [], ...file.exports || []],
816
- env: { ...prev.env || {}, ...file.env || {} }
817
- };
818
- }
819
- return acc;
820
- }, []);
3746
+ return getSource(file);
821
3747
  }
822
- static getMode(path3) {
823
- if (!path3) {
3748
+ static getMode(path5) {
3749
+ if (!path5) {
824
3750
  return "directory";
825
3751
  }
826
- return extname(path3) ? "file" : "directory";
3752
+ return extname(path5) ? "file" : "directory";
827
3753
  }
828
3754
  static get extensions() {
829
3755
  return [".js", ".ts", ".tsx"];
@@ -838,18 +3764,10 @@ _isWriting = new WeakMap();
838
3764
  _timeout = new WeakMap();
839
3765
  _queue = new WeakMap();
840
3766
  _validate = new WeakSet();
841
- validate_fn = function(file) {
842
- if (!file.validate) {
843
- return;
844
- }
845
- if (!file.path.toLowerCase().endsWith(file.baseName.toLowerCase())) {
846
- throw new Error(`${file.path} should end with the baseName ${file.baseName}`);
847
- }
848
- };
849
3767
  _add = new WeakSet();
850
3768
  add_fn = async function(file) {
851
3769
  const controller = new AbortController();
852
- const resolvedFile = { id: crypto2.randomUUID(), ...file };
3770
+ const resolvedFile = { id: crypto2.randomUUID(), name: transformers_default.trimExtName(file.baseName), ...file };
853
3771
  __privateGet(this, _cache).set(resolvedFile.path, [{ cancel: () => controller.abort(), ...resolvedFile }]);
854
3772
  if (__privateGet(this, _queue)) {
855
3773
  await __privateGet(this, _queue).run(
@@ -880,16 +3798,41 @@ ${file.source}` : "",
880
3798
  return __privateMethod(this, _add, add_fn).call(this, file);
881
3799
  };
882
3800
  var FileManager = _FileManager;
3801
+ function getSource(file) {
3802
+ if (!FileManager.isExtensionAllowed(file.baseName)) {
3803
+ return file.source;
3804
+ }
3805
+ const exports = file.exports ? combineExports(file.exports) : [];
3806
+ const imports = file.imports ? combineImports(file.imports, exports, file.source) : [];
3807
+ const importNodes = imports.filter((item) => {
3808
+ return item.path !== transformers_default.trimExtName(file.path);
3809
+ }).map((item) => {
3810
+ return factory.createImportDeclaration({
3811
+ name: item.name,
3812
+ path: item.root ? getRelativePath(item.root, item.path) : item.path,
3813
+ isTypeOnly: item.isTypeOnly
3814
+ });
3815
+ });
3816
+ const exportNodes = exports.map(
3817
+ (item) => factory.createExportDeclaration({
3818
+ name: item.name,
3819
+ path: item.path,
3820
+ isTypeOnly: item.isTypeOnly,
3821
+ asAlias: item.asAlias
3822
+ })
3823
+ );
3824
+ return [print([...importNodes, ...exportNodes]), getEnvSource(file.source, file.env)].join("\n");
3825
+ }
883
3826
  function combineExports(exports) {
884
3827
  const combinedExports = orderBy(exports, [(v) => !v.isTypeOnly], ["asc"]).reduce((prev, curr) => {
885
3828
  const name = curr.name;
886
3829
  const prevByPath = prev.findLast((imp) => imp.path === curr.path);
887
- const prevByPathAndIsTypeOnly = prev.findLast((imp) => imp.path === curr.path && isEqual(imp.name, name) && imp.isTypeOnly);
3830
+ const prevByPathAndIsTypeOnly = prev.findLast((imp) => imp.path === curr.path && (0, import_lodash.default)(imp.name, name) && imp.isTypeOnly);
888
3831
  if (prevByPathAndIsTypeOnly) {
889
3832
  return prev;
890
3833
  }
891
3834
  const uniquePrev = prev.findLast(
892
- (imp) => imp.path === curr.path && isEqual(imp.name, name) && imp.isTypeOnly === curr.isTypeOnly && imp.asAlias === curr.asAlias
3835
+ (imp) => imp.path === curr.path && (0, import_lodash.default)(imp.name, name) && imp.isTypeOnly === curr.isTypeOnly && imp.asAlias === curr.asAlias
893
3836
  );
894
3837
  if (uniquePrev || Array.isArray(name) && !name.length || prevByPath?.asAlias && !curr.asAlias) {
895
3838
  return prev;
@@ -922,11 +3865,11 @@ function combineImports(imports, exports, source) {
922
3865
  return checker(importName) || exports.some(({ name: name2 }) => Array.isArray(name2) ? name2.some(checker) : checker(name2));
923
3866
  };
924
3867
  if (Array.isArray(name)) {
925
- name = name.filter((item) => hasImportInSource(item));
3868
+ name = name.filter((item) => typeof item === "string" ? hasImportInSource(item) : hasImportInSource(item.propertyName));
926
3869
  }
927
3870
  const prevByPath = prev.findLast((imp) => imp.path === curr.path && imp.isTypeOnly === curr.isTypeOnly);
928
- const uniquePrev = prev.findLast((imp) => imp.path === curr.path && isEqual(imp.name, name) && imp.isTypeOnly === curr.isTypeOnly);
929
- const prevByPathNameAndIsTypeOnly = prev.findLast((imp) => imp.path === curr.path && isEqual(imp.name, name) && imp.isTypeOnly);
3871
+ const uniquePrev = prev.findLast((imp) => imp.path === curr.path && (0, import_lodash.default)(imp.name, name) && imp.isTypeOnly === curr.isTypeOnly);
3872
+ const prevByPathNameAndIsTypeOnly = prev.findLast((imp) => imp.path === curr.path && (0, import_lodash.default)(imp.name, name) && imp.isTypeOnly);
930
3873
  if (prevByPathNameAndIsTypeOnly) {
931
3874
  return prev;
932
3875
  }
@@ -968,13 +3911,90 @@ function getEnvSource(source, env) {
968
3911
  throw new TypeError(`Environment should be in upperCase for ${key}`);
969
3912
  }
970
3913
  if (typeof replaceBy === "string") {
971
- prev = transformers.searchAndReplace({ text: prev.replaceAll(`process.env.${key}`, replaceBy), replaceBy, prefix: "process.env", key });
972
- prev = transformers.searchAndReplace({ text: prev.replaceAll(new RegExp(`(declare const).*
3914
+ prev = transformers_default.searchAndReplace({ text: prev.replaceAll(`process.env.${key}`, replaceBy), replaceBy, prefix: "process.env", key });
3915
+ prev = transformers_default.searchAndReplace({ text: prev.replaceAll(new RegExp(`(declare const).*
973
3916
  `, "ig"), ""), replaceBy, key });
974
3917
  }
975
3918
  return prev;
976
3919
  }, source);
977
3920
  }
3921
+
3922
+ // src/logger.ts
3923
+ init_esm_shims();
3924
+ var LogLevel = {
3925
+ silent: "silent",
3926
+ info: "info",
3927
+ debug: "debug"
3928
+ };
3929
+ function createLogger({ logLevel, name, spinner }) {
3930
+ const logs = [];
3931
+ const log = (message) => {
3932
+ if (message && spinner) {
3933
+ spinner.text = message;
3934
+ logs.push(message);
3935
+ }
3936
+ };
3937
+ const error = (message) => {
3938
+ if (message) {
3939
+ throw new Error(message || "Something went wrong");
3940
+ }
3941
+ };
3942
+ const warn = (message) => {
3943
+ if (message && spinner) {
3944
+ spinner.warn(pc2.yellow(message));
3945
+ logs.push(message);
3946
+ }
3947
+ };
3948
+ const info = (message) => {
3949
+ if (message && spinner && logLevel !== LogLevel.silent) {
3950
+ spinner.info(message);
3951
+ logs.push(message);
3952
+ }
3953
+ };
3954
+ const logger = {
3955
+ name,
3956
+ logLevel,
3957
+ log,
3958
+ error,
3959
+ warn,
3960
+ info,
3961
+ spinner,
3962
+ logs
3963
+ };
3964
+ return logger;
3965
+ }
3966
+ var defaultColours = ["black", "blue", "darkBlue", "cyan", "gray", "green", "darkGreen", "magenta", "red", "darkRed", "yellow", "darkYellow"];
3967
+ function randomColour(text, colours = defaultColours) {
3968
+ if (!text) {
3969
+ return "white";
3970
+ }
3971
+ const random = seedrandom(text);
3972
+ const colour = colours.at(Math.floor(random() * colours.length)) || "white";
3973
+ return colour;
3974
+ }
3975
+ function randomPicoColour(text, colors = defaultColours) {
3976
+ const colours = pc2.createColors(true);
3977
+ if (!text) {
3978
+ return colours.white(text);
3979
+ }
3980
+ const colour = randomColour(text, colors);
3981
+ const isDark = colour.includes("dark");
3982
+ const key = colour.replace("dark", "").toLowerCase();
3983
+ const formatter = colours[key];
3984
+ if (isDark) {
3985
+ return pc2.bold(formatter(text));
3986
+ }
3987
+ if (typeof formatter !== "function") {
3988
+ throw new Error("Formatter for picoColor is not of type function/Formatter");
3989
+ }
3990
+ return formatter(text);
3991
+ }
3992
+
3993
+ // src/PluginManager.ts
3994
+ init_esm_shims();
3995
+
3996
+ // src/utils/EventEmitter.ts
3997
+ init_esm_shims();
978
3998
  var _emitter;
979
3999
  var EventEmitter = class {
980
4000
  constructor() {
@@ -995,6 +4015,9 @@ var EventEmitter = class {
995
4015
  }
996
4016
  };
997
4017
  _emitter = new WeakMap();
4018
+
4019
+ // src/utils/Queue.ts
4020
+ init_esm_shims();
998
4021
  var _queue2, _workerCount, _maxParallel, _debug, _work, work_fn;
999
4022
  var Queue = class {
1000
4023
  constructor(maxParallel, debug = false) {
@@ -1008,8 +4031,8 @@ var Queue = class {
1008
4031
  __privateSet(this, _debug, debug);
1009
4032
  }
1010
4033
  run(job, options = { controller: new AbortController(), name: crypto2.randomUUID(), description: "" }) {
1011
- return new Promise((resolve2, reject) => {
1012
- const item = { reject, resolve: resolve2, job, name: options.name, description: options.description || options.name };
4034
+ return new Promise((resolve3, reject) => {
4035
+ const item = { reject, resolve: resolve3, job, name: options.name, description: options.description || options.name };
1013
4036
  options.controller?.signal.addEventListener("abort", () => {
1014
4037
  __privateSet(this, _queue2, __privateGet(this, _queue2).filter((queueItem) => queueItem.name === item.name));
1015
4038
  reject("Aborted");
@@ -1019,8 +4042,8 @@ var Queue = class {
1019
4042
  });
1020
4043
  }
1021
4044
  runSync(job, options = { controller: new AbortController(), name: crypto2.randomUUID(), description: "" }) {
1022
- new Promise((resolve2, reject) => {
1023
- const item = { reject, resolve: resolve2, job, name: options.name, description: options.description || options.name };
4045
+ new Promise((resolve3, reject) => {
4046
+ const item = { reject, resolve: resolve3, job, name: options.name, description: options.description || options.name };
1024
4047
  options.controller?.signal.addEventListener("abort", () => {
1025
4048
  __privateSet(this, _queue2, __privateGet(this, _queue2).filter((queueItem) => queueItem.name === item.name));
1026
4049
  });
@@ -1047,13 +4070,13 @@ work_fn = function() {
1047
4070
  __privateWrapper(this, _workerCount)._++;
1048
4071
  let entry;
1049
4072
  while (entry = __privateGet(this, _queue2).shift()) {
1050
- const { reject, resolve: resolve2, job, name, description } = entry;
4073
+ const { reject, resolve: resolve3, job, name, description } = entry;
1051
4074
  if (__privateGet(this, _debug)) {
1052
4075
  performance.mark(name + "_start");
1053
4076
  }
1054
4077
  job().then((result) => {
1055
4078
  this.eventEmitter.emit("jobDone", result);
1056
- resolve2(result);
4079
+ resolve3(result);
1057
4080
  if (__privateGet(this, _debug)) {
1058
4081
  performance.mark(name + "_stop");
1059
4082
  performance.measure(description, name + "_start", name + "_stop");
@@ -1067,6 +4090,7 @@ work_fn = function() {
1067
4090
  };
1068
4091
 
1069
4092
  // src/utils/uniqueName.ts
4093
+ init_esm_shims();
1070
4094
  function setUniqueName(originalName, data) {
1071
4095
  let used = data[originalName] || 0;
1072
4096
  if (used) {
@@ -1078,6 +4102,7 @@ function setUniqueName(originalName, data) {
1078
4102
  }
1079
4103
 
1080
4104
  // src/errors.ts
4105
+ init_esm_shims();
1081
4106
  var Warning = class extends Error {
1082
4107
  constructor(message, options) {
1083
4108
  super(message, { cause: options?.cause });
@@ -1087,7 +4112,11 @@ var Warning = class extends Error {
1087
4112
  var ValidationPluginError = class extends Error {
1088
4113
  };
1089
4114
 
4115
+ // src/plugin.ts
4116
+ init_esm_shims();
4117
+
1090
4118
  // src/utils/cache.ts
4119
+ init_esm_shims();
1091
4120
  function createPluginCache(Store = /* @__PURE__ */ Object.create(null)) {
1092
4121
  return {
1093
4122
  set(id, value) {
@@ -1127,8 +4156,7 @@ var definePlugin = createPlugin((options) => {
1127
4156
  return {
1128
4157
  name: pluginName,
1129
4158
  options,
1130
- key: ["controller", "core"],
1131
- kind: "controller",
4159
+ key: ["core"],
1132
4160
  api() {
1133
4161
  return {
1134
4162
  get config() {
@@ -1156,8 +4184,8 @@ var definePlugin = createPlugin((options) => {
1156
4184
  };
1157
4185
  },
1158
4186
  resolvePath(baseName) {
1159
- const root = path.resolve(this.config.root, this.config.output.path);
1160
- return path.resolve(root, baseName);
4187
+ const root = path4.resolve(this.config.root, this.config.output.path);
4188
+ return path4.resolve(root, baseName);
1161
4189
  },
1162
4190
  resolveName(name) {
1163
4191
  return name;
@@ -1165,7 +4193,11 @@ var definePlugin = createPlugin((options) => {
1165
4193
  };
1166
4194
  });
1167
4195
 
4196
+ // src/PromiseManager.ts
4197
+ init_esm_shims();
4198
+
1168
4199
  // src/utils/executeStrategies.ts
4200
+ init_esm_shims();
1169
4201
  function hookSeq(promises) {
1170
4202
  return promises.filter(Boolean).reduce(
1171
4203
  (promise, func) => {
@@ -1252,7 +4284,7 @@ var PluginManager = class {
1252
4284
  __privateAdd(this, _executeSync);
1253
4285
  __privateAdd(this, _catcher);
1254
4286
  __privateAdd(this, _parse);
1255
- this.eventEmitter = new EventEmitter();
4287
+ this.events = new EventEmitter();
1256
4288
  this.executed = [];
1257
4289
  __privateAdd(this, _core, void 0);
1258
4290
  __privateAdd(this, _usedPluginNames, {});
@@ -1264,11 +4296,14 @@ var PluginManager = class {
1264
4296
  hookName: "resolvePath",
1265
4297
  parameters: [params.baseName, params.directory, params.options]
1266
4298
  });
1267
- if (paths && paths?.length > 1) {
1268
- throw new Error(
4299
+ if (paths && paths?.length > 1 && this.logger.logLevel === LogLevel.debug) {
4300
+ this.logger.warn(
1269
4301
  `Cannot return a path where the 'pluginKey' ${params.pluginKey ? JSON.stringify(params.pluginKey) : '"'} is not unique enough
1270
4302
 
1271
- Paths: ${JSON.stringify(paths, void 0, 2)}`
4303
+ Paths: ${JSON.stringify(paths, void 0, 2)}
4304
+
4305
+ Falling back on the first item.
4306
+ `
1272
4307
  );
1273
4308
  }
1274
4309
  return paths?.at(0);
@@ -1285,11 +4320,14 @@ Paths: ${JSON.stringify(paths, void 0, 2)}`
1285
4320
  hookName: "resolveName",
1286
4321
  parameters: [params.name, params.type]
1287
4322
  });
1288
- if (names && names?.length > 1) {
1289
- throw new Error(
4323
+ if (names && names?.length > 1 && this.logger.logLevel === LogLevel.debug) {
4324
+ this.logger.warn(
1290
4325
  `Cannot return a name where the 'pluginKey' ${params.pluginKey ? JSON.stringify(params.pluginKey) : '"'} is not unique enough
1291
4326
 
1292
- Names: ${JSON.stringify(names, void 0, 2)}`
4327
+ Names: ${JSON.stringify(names, void 0, 2)}
4328
+
4329
+ Falling back on the first item.
4330
+ `
1293
4331
  );
1294
4332
  }
1295
4333
  return transformReservedWord(names?.at(0) || params.name);
@@ -1321,11 +4359,14 @@ Names: ${JSON.stringify(names, void 0, 2)}`
1321
4359
  });
1322
4360
  return this;
1323
4361
  }
4362
+ /**
4363
+ * Instead of calling `pluginManager.events.on` you can use `pluginManager.on`. This one also has better types.
4364
+ */
1324
4365
  on(eventName, handler) {
1325
- this.eventEmitter.on(eventName, handler);
4366
+ this.events.on(eventName, handler);
1326
4367
  }
1327
4368
  /**
1328
- * Run only hook for a specific plugin name
4369
+ * Run a specific hookName for plugin x.
1329
4370
  */
1330
4371
  hookForPlugin({
1331
4372
  pluginKey,
@@ -1343,6 +4384,9 @@ Names: ${JSON.stringify(names, void 0, 2)}`
1343
4384
  }).filter(Boolean);
1344
4385
  return Promise.all(promises);
1345
4386
  }
4387
+ /**
4388
+ * Run a specific hookName for plugin x.
4389
+ */
1346
4390
  hookForPluginSync({
1347
4391
  pluginKey,
1348
4392
  hookName,
@@ -1359,7 +4403,7 @@ Names: ${JSON.stringify(names, void 0, 2)}`
1359
4403
  }).filter(Boolean);
1360
4404
  }
1361
4405
  /**
1362
- * Chains, first non-null result stops and returns
4406
+ * First non-null result stops and will return it's value.
1363
4407
  */
1364
4408
  async hookFirst({
1365
4409
  hookName,
@@ -1387,7 +4431,7 @@ Names: ${JSON.stringify(names, void 0, 2)}`
1387
4431
  return __privateGet(this, _promiseManager).run("first", promises);
1388
4432
  }
1389
4433
  /**
1390
- * Chains, first non-null result stops and returns
4434
+ * First non-null result stops and will return it's value.
1391
4435
  */
1392
4436
  hookFirstSync({
1393
4437
  hookName,
@@ -1415,7 +4459,7 @@ Names: ${JSON.stringify(names, void 0, 2)}`
1415
4459
  return parseResult;
1416
4460
  }
1417
4461
  /**
1418
- * Parallel, runs all plugins
4462
+ * Run all plugins in parallel(order will be based on `this.plugin` and if `pre` or `post` is set).
1419
4463
  */
1420
4464
  async hookParallel({
1421
4465
  hookName,
@@ -1434,7 +4478,7 @@ Names: ${JSON.stringify(names, void 0, 2)}`
1434
4478
  return results.filter((result) => result.status === "fulfilled").map((result) => result.value);
1435
4479
  }
1436
4480
  /**
1437
- * Chains, reduces returned value, handling the reduced value as the first hook argument
4481
+ * 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.
1438
4482
  */
1439
4483
  hookReduceArg0({
1440
4484
  hookName,
@@ -1472,20 +4516,19 @@ Names: ${JSON.stringify(names, void 0, 2)}`
1472
4516
  }
1473
4517
  getPluginsByKey(hookName, pluginKey) {
1474
4518
  const plugins = [...this.plugins];
1475
- const [searchKind, searchPluginName, searchIdentifier] = pluginKey;
4519
+ const [searchPluginName, searchIdentifier] = pluginKey;
1476
4520
  const pluginByPluginName = plugins.filter((plugin) => plugin[hookName]).filter((item) => {
1477
- const [kind, name, identifier] = item.key;
4521
+ const [name, identifier] = item.key;
1478
4522
  const identifierCheck = identifier?.toString() === searchIdentifier?.toString();
1479
- const kindCheck = kind === searchKind;
1480
4523
  const nameCheck = name === searchPluginName;
1481
4524
  if (searchIdentifier) {
1482
- return identifierCheck && kindCheck && nameCheck;
4525
+ return identifierCheck && nameCheck;
1483
4526
  }
1484
- return kindCheck && nameCheck;
4527
+ return nameCheck;
1485
4528
  });
1486
4529
  if (!pluginByPluginName?.length) {
1487
4530
  const corePlugin = plugins.find((plugin) => plugin.name === "core" && plugin[hookName]);
1488
- if (this.logger.logLevel === "info") {
4531
+ if (this.logger.logLevel === LogLevel.debug) {
1489
4532
  if (corePlugin) {
1490
4533
  this.logger.warn(`No hook '${hookName}' for pluginKey '${JSON.stringify(pluginKey)}' found, falling back on the '@kubb/core' plugin`);
1491
4534
  } else {
@@ -1513,7 +4556,7 @@ Names: ${JSON.stringify(names, void 0, 2)}`
1513
4556
  }
1514
4557
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
1515
4558
  static get hooks() {
1516
- return ["validate", "buildStart", "resolvePath", "resolveName", "load", "transform", "writeFile", "buildEnd"];
4559
+ return ["buildStart", "resolvePath", "resolveName", "load", "transform", "writeFile", "buildEnd"];
1517
4560
  }
1518
4561
  };
1519
4562
  _core = new WeakMap();
@@ -1523,7 +4566,7 @@ _getSortedPlugins = new WeakSet();
1523
4566
  getSortedPlugins_fn = function(hookName) {
1524
4567
  const plugins = [...this.plugins].filter((plugin) => plugin.name !== "core");
1525
4568
  if (hookName) {
1526
- if (this.logger.logLevel === "info") {
4569
+ if (this.logger.logLevel === LogLevel.info) {
1527
4570
  const containsHookName = plugins.some((item) => item[hookName]);
1528
4571
  if (!containsHookName) {
1529
4572
  this.logger.warn(`No hook ${hookName} found`);
@@ -1531,12 +4574,28 @@ getSortedPlugins_fn = function(hookName) {
1531
4574
  }
1532
4575
  return plugins.filter((item) => item[hookName]);
1533
4576
  }
1534
- return plugins;
4577
+ return plugins.map((plugin) => {
4578
+ if (plugin.pre) {
4579
+ const isValid = plugin.pre.every((pluginName2) => plugins.find((pluginToFind) => pluginToFind.name === pluginName2));
4580
+ if (!isValid) {
4581
+ throw new ValidationPluginError(`This plugin has a pre set that is not valid(${JSON.stringify(plugin.pre, void 0, 2)})`);
4582
+ }
4583
+ }
4584
+ return plugin;
4585
+ }).sort((a, b) => {
4586
+ if (b.pre?.includes(a.name)) {
4587
+ return 1;
4588
+ }
4589
+ if (b.post?.includes(a.name)) {
4590
+ return -1;
4591
+ }
4592
+ return 0;
4593
+ });
1535
4594
  };
1536
4595
  _addExecutedToCallStack = new WeakSet();
1537
4596
  addExecutedToCallStack_fn = function(executer) {
1538
4597
  if (executer) {
1539
- this.eventEmitter.emit("executed", executer);
4598
+ this.events.emit("executed", executer);
1540
4599
  this.executed.push(executer);
1541
4600
  }
1542
4601
  };
@@ -1552,7 +4611,7 @@ execute_fn = function({
1552
4611
  if (!hook) {
1553
4612
  return null;
1554
4613
  }
1555
- this.eventEmitter.emit("execute", { strategy, hookName, parameters, plugin });
4614
+ this.events.emit("execute", { strategy, hookName, parameters, plugin });
1556
4615
  const task = Promise.resolve().then(() => {
1557
4616
  if (typeof hook === "function") {
1558
4617
  const possiblePromiseResult = hook.apply({ ...__privateGet(this, _core).api, plugin }, parameters);
@@ -1590,7 +4649,7 @@ executeSync_fn = function({
1590
4649
  if (!hook) {
1591
4650
  return null;
1592
4651
  }
1593
- this.eventEmitter.emit("execute", { strategy, hookName, parameters, plugin });
4652
+ this.events.emit("execute", { strategy, hookName, parameters, plugin });
1594
4653
  try {
1595
4654
  if (typeof hook === "function") {
1596
4655
  const fn = hook.apply({ ...__privateGet(this, _core).api, plugin }, parameters);
@@ -1616,13 +4675,13 @@ catcher_fn = function(e, plugin, hookName) {
1616
4675
  const text = `${e.message} (plugin: ${plugin?.name || "unknown"}, hook: ${hookName || "unknown"})
1617
4676
  `;
1618
4677
  this.logger.error(text);
1619
- this.eventEmitter.emit("error", e);
4678
+ this.events.emit("error", e);
1620
4679
  };
1621
4680
  _parse = new WeakSet();
1622
4681
  parse_fn = function(plugin, pluginManager, context) {
1623
4682
  const usedPluginNames = __privateGet(pluginManager, _usedPluginNames);
1624
4683
  setUniqueName(plugin.name, usedPluginNames);
1625
- const key = plugin.key || [plugin.kind, plugin.name, usedPluginNames[plugin.name]].filter(Boolean);
4684
+ const key = [plugin.name, usedPluginNames[plugin.name]].filter(Boolean);
1626
4685
  if (plugin.name !== "core" && usedPluginNames[plugin.name] >= 2) {
1627
4686
  pluginManager.logger.warn("Using multiple of the same plugin is an experimental feature");
1628
4687
  }
@@ -1658,7 +4717,7 @@ async function setup(options) {
1658
4717
  } catch (e) {
1659
4718
  if (isInputPath(config)) {
1660
4719
  throw new Error(
1661
- "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),
4720
+ "Cannot read file/URL defined in `input.path` or set with `kubb generate PATH` in the CLI of your Kubb config " + pc2.dim(config.input.path),
1662
4721
  {
1663
4722
  cause: e
1664
4723
  }
@@ -1669,11 +4728,11 @@ async function setup(options) {
1669
4728
  await clean(config.output.path);
1670
4729
  }
1671
4730
  const queueTask = async (file) => {
1672
- const { path: path3 } = file;
4731
+ const { path: path5 } = file;
1673
4732
  let code = FileManager.getSource(file);
1674
4733
  const { result: loadedResult } = await pluginManager.hookFirst({
1675
4734
  hookName: "load",
1676
- parameters: [path3]
4735
+ parameters: [path5]
1677
4736
  });
1678
4737
  if (loadedResult && isPromise(loadedResult)) {
1679
4738
  code = await loadedResult;
@@ -1684,7 +4743,7 @@ async function setup(options) {
1684
4743
  if (code) {
1685
4744
  const transformedCode = await pluginManager.hookReduceArg0({
1686
4745
  hookName: "transform",
1687
- parameters: [code, path3],
4746
+ parameters: [code, path5],
1688
4747
  reduce: transformReducer
1689
4748
  });
1690
4749
  if (config.output.write || config.output.write === void 0) {
@@ -1692,12 +4751,12 @@ async function setup(options) {
1692
4751
  return pluginManager.hookForPlugin({
1693
4752
  pluginKey: file.meta?.pluginKey,
1694
4753
  hookName: "writeFile",
1695
- parameters: [transformedCode, path3]
4754
+ parameters: [transformedCode, path5]
1696
4755
  });
1697
4756
  }
1698
4757
  return pluginManager.hookFirst({
1699
4758
  hookName: "writeFile",
1700
- parameters: [transformedCode, path3]
4759
+ parameters: [transformedCode, path5]
1701
4760
  });
1702
4761
  }
1703
4762
  }
@@ -1710,8 +4769,8 @@ async function setup(options) {
1710
4769
  if (logger.logLevel === LogLevel.info) {
1711
4770
  logger.spinner.start(`\u{1F4BE} Writing`);
1712
4771
  }
1713
- if (logger.logLevel === "debug") {
1714
- logger.info(`PluginKey ${pc3.dim(JSON.stringify(plugin.key))}
4772
+ if (logger.logLevel === LogLevel.debug) {
4773
+ logger.info(`PluginKey ${pc2.dim(JSON.stringify(plugin.key))}
1715
4774
  with source
1716
4775
 
1717
4776
  ${code}`);
@@ -1723,8 +4782,8 @@ ${code}`);
1723
4782
  const messsage = `${randomPicoColour(plugin.name)} Executing ${hookName}`;
1724
4783
  if (logger.logLevel === LogLevel.info && logger.spinner) {
1725
4784
  if (hookName === "writeFile") {
1726
- const [_code, path3] = parameters;
1727
- logger.spinner.suffixText = pc3.dim(path3);
4785
+ const [_code, path5] = parameters;
4786
+ logger.spinner.suffixText = pc2.dim(path5);
1728
4787
  } else {
1729
4788
  logger.spinner.suffixText = messsage;
1730
4789
  }
@@ -1732,9 +4791,9 @@ ${code}`);
1732
4791
  if (logger.logLevel === LogLevel.debug) {
1733
4792
  logger.info(messsage);
1734
4793
  const logs = [
1735
- parameters && `${pc3.bgWhite(`Parameters`)} ${randomPicoColour(plugin.name)} ${hookName}`,
4794
+ parameters && `${pc2.bgWhite(`Parameters`)} ${randomPicoColour(plugin.name)} ${hookName}`,
1736
4795
  JSON.stringify(parameters, void 0, 2),
1737
- output && `${pc3.bgWhite("Output")} ${randomPicoColour(plugin.name)} ${hookName}`,
4796
+ output && `${pc2.bgWhite("Output")} ${randomPicoColour(plugin.name)} ${hookName}`,
1738
4797
  output
1739
4798
  ].filter(Boolean);
1740
4799
  console.log(logs.join("\n"));
@@ -1745,10 +4804,6 @@ ${code}`);
1745
4804
  async function build(options) {
1746
4805
  const pluginManager = await setup(options);
1747
4806
  const { fileManager, logger } = pluginManager;
1748
- await pluginManager.hookParallel({
1749
- hookName: "validate",
1750
- parameters: [pluginManager.plugins]
1751
- });
1752
4807
  await pluginManager.hookParallel({
1753
4808
  hookName: "buildStart",
1754
4809
  parameters: [options.config]
@@ -1764,10 +4819,6 @@ async function safeBuild(options) {
1764
4819
  const pluginManager = await setup(options);
1765
4820
  const { fileManager, logger } = pluginManager;
1766
4821
  try {
1767
- await pluginManager.hookParallel({
1768
- hookName: "validate",
1769
- parameters: [pluginManager.plugins]
1770
- });
1771
4822
  await pluginManager.hookParallel({
1772
4823
  hookName: "buildStart",
1773
4824
  parameters: [options.config]
@@ -1784,6 +4835,7 @@ async function safeBuild(options) {
1784
4835
  }
1785
4836
 
1786
4837
  // src/Generator.ts
4838
+ init_esm_shims();
1787
4839
  var _options3, _context;
1788
4840
  var Generator = class {
1789
4841
  constructor(options, context) {
@@ -1809,6 +4861,296 @@ var Generator = class {
1809
4861
  };
1810
4862
  _options3 = new WeakMap();
1811
4863
  _context = new WeakMap();
4864
+
4865
+ // src/PackageManager.ts
4866
+ init_esm_shims();
4867
+
4868
+ // ../../node_modules/.pnpm/find-up@6.3.0/node_modules/find-up/index.js
4869
+ init_esm_shims();
4870
+
4871
+ // ../../node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js
4872
+ init_esm_shims();
4873
+
4874
+ // ../../node_modules/.pnpm/p-locate@6.0.0/node_modules/p-locate/index.js
4875
+ init_esm_shims();
4876
+
4877
+ // ../../node_modules/.pnpm/p-limit@4.0.0/node_modules/p-limit/index.js
4878
+ init_esm_shims();
4879
+
4880
+ // ../../node_modules/.pnpm/yocto-queue@1.0.0/node_modules/yocto-queue/index.js
4881
+ init_esm_shims();
4882
+ var Node = class {
4883
+ constructor(value) {
4884
+ __publicField(this, "value");
4885
+ __publicField(this, "next");
4886
+ this.value = value;
4887
+ }
4888
+ };
4889
+ var _head, _tail, _size;
4890
+ var Queue2 = class {
4891
+ constructor() {
4892
+ __privateAdd(this, _head, void 0);
4893
+ __privateAdd(this, _tail, void 0);
4894
+ __privateAdd(this, _size, void 0);
4895
+ this.clear();
4896
+ }
4897
+ enqueue(value) {
4898
+ const node = new Node(value);
4899
+ if (__privateGet(this, _head)) {
4900
+ __privateGet(this, _tail).next = node;
4901
+ __privateSet(this, _tail, node);
4902
+ } else {
4903
+ __privateSet(this, _head, node);
4904
+ __privateSet(this, _tail, node);
4905
+ }
4906
+ __privateWrapper(this, _size)._++;
4907
+ }
4908
+ dequeue() {
4909
+ const current = __privateGet(this, _head);
4910
+ if (!current) {
4911
+ return;
4912
+ }
4913
+ __privateSet(this, _head, __privateGet(this, _head).next);
4914
+ __privateWrapper(this, _size)._--;
4915
+ return current.value;
4916
+ }
4917
+ clear() {
4918
+ __privateSet(this, _head, void 0);
4919
+ __privateSet(this, _tail, void 0);
4920
+ __privateSet(this, _size, 0);
4921
+ }
4922
+ get size() {
4923
+ return __privateGet(this, _size);
4924
+ }
4925
+ *[Symbol.iterator]() {
4926
+ let current = __privateGet(this, _head);
4927
+ while (current) {
4928
+ yield current.value;
4929
+ current = current.next;
4930
+ }
4931
+ }
4932
+ };
4933
+ _head = new WeakMap();
4934
+ _tail = new WeakMap();
4935
+ _size = new WeakMap();
4936
+
4937
+ // ../../node_modules/.pnpm/p-limit@4.0.0/node_modules/p-limit/index.js
4938
+ function pLimit(concurrency) {
4939
+ if (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) {
4940
+ throw new TypeError("Expected `concurrency` to be a number from 1 and up");
4941
+ }
4942
+ const queue = new Queue2();
4943
+ let activeCount = 0;
4944
+ const next = () => {
4945
+ activeCount--;
4946
+ if (queue.size > 0) {
4947
+ queue.dequeue()();
4948
+ }
4949
+ };
4950
+ const run = async (fn, resolve3, args) => {
4951
+ activeCount++;
4952
+ const result = (async () => fn(...args))();
4953
+ resolve3(result);
4954
+ try {
4955
+ await result;
4956
+ } catch {
4957
+ }
4958
+ next();
4959
+ };
4960
+ const enqueue = (fn, resolve3, args) => {
4961
+ queue.enqueue(run.bind(void 0, fn, resolve3, args));
4962
+ (async () => {
4963
+ await Promise.resolve();
4964
+ if (activeCount < concurrency && queue.size > 0) {
4965
+ queue.dequeue()();
4966
+ }
4967
+ })();
4968
+ };
4969
+ const generator = (fn, ...args) => new Promise((resolve3) => {
4970
+ enqueue(fn, resolve3, args);
4971
+ });
4972
+ Object.defineProperties(generator, {
4973
+ activeCount: {
4974
+ get: () => activeCount
4975
+ },
4976
+ pendingCount: {
4977
+ get: () => queue.size
4978
+ },
4979
+ clearQueue: {
4980
+ value: () => {
4981
+ queue.clear();
4982
+ }
4983
+ }
4984
+ });
4985
+ return generator;
4986
+ }
4987
+
4988
+ // ../../node_modules/.pnpm/p-locate@6.0.0/node_modules/p-locate/index.js
4989
+ var EndError = class extends Error {
4990
+ constructor(value) {
4991
+ super();
4992
+ this.value = value;
4993
+ }
4994
+ };
4995
+ var testElement = async (element, tester) => tester(await element);
4996
+ var finder = async (element) => {
4997
+ const values = await Promise.all(element);
4998
+ if (values[1] === true) {
4999
+ throw new EndError(values[0]);
5000
+ }
5001
+ return false;
5002
+ };
5003
+ async function pLocate(iterable, tester, {
5004
+ concurrency = Number.POSITIVE_INFINITY,
5005
+ preserveOrder = true
5006
+ } = {}) {
5007
+ const limit = pLimit(concurrency);
5008
+ const items = [...iterable].map((element) => [element, limit(testElement, element, tester)]);
5009
+ const checkLimit = pLimit(preserveOrder ? 1 : Number.POSITIVE_INFINITY);
5010
+ try {
5011
+ await Promise.all(items.map((element) => checkLimit(finder, element)));
5012
+ } catch (error) {
5013
+ if (error instanceof EndError) {
5014
+ return error.value;
5015
+ }
5016
+ throw error;
5017
+ }
5018
+ }
5019
+
5020
+ // ../../node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js
5021
+ var typeMappings = {
5022
+ directory: "isDirectory",
5023
+ file: "isFile"
5024
+ };
5025
+ function checkType(type) {
5026
+ if (Object.hasOwnProperty.call(typeMappings, type)) {
5027
+ return;
5028
+ }
5029
+ throw new Error(`Invalid type specified: ${type}`);
5030
+ }
5031
+ var matchType = (type, stat) => stat[typeMappings[type]]();
5032
+ var toPath = (urlOrPath) => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;
5033
+ async function locatePath(paths, {
5034
+ cwd = process2.cwd(),
5035
+ type = "file",
5036
+ allowSymlinks = true,
5037
+ concurrency,
5038
+ preserveOrder
5039
+ } = {}) {
5040
+ checkType(type);
5041
+ cwd = toPath(cwd);
5042
+ const statFunction = allowSymlinks ? promises.stat : promises.lstat;
5043
+ return pLocate(paths, async (path_) => {
5044
+ try {
5045
+ const stat = await statFunction(path4.resolve(cwd, path_));
5046
+ return matchType(type, stat);
5047
+ } catch {
5048
+ return false;
5049
+ }
5050
+ }, { concurrency, preserveOrder });
5051
+ }
5052
+ function locatePathSync(paths, {
5053
+ cwd = process2.cwd(),
5054
+ type = "file",
5055
+ allowSymlinks = true
5056
+ } = {}) {
5057
+ checkType(type);
5058
+ cwd = toPath(cwd);
5059
+ const statFunction = allowSymlinks ? fs3.statSync : fs3.lstatSync;
5060
+ for (const path_ of paths) {
5061
+ try {
5062
+ const stat = statFunction(path4.resolve(cwd, path_), {
5063
+ throwIfNoEntry: false
5064
+ });
5065
+ if (!stat) {
5066
+ continue;
5067
+ }
5068
+ if (matchType(type, stat)) {
5069
+ return path_;
5070
+ }
5071
+ } catch {
5072
+ }
5073
+ }
5074
+ }
5075
+
5076
+ // ../../node_modules/.pnpm/path-exists@5.0.0/node_modules/path-exists/index.js
5077
+ init_esm_shims();
5078
+
5079
+ // ../../node_modules/.pnpm/find-up@6.3.0/node_modules/find-up/index.js
5080
+ var toPath2 = (urlOrPath) => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;
5081
+ var findUpStop = Symbol("findUpStop");
5082
+ async function findUpMultiple(name, options = {}) {
5083
+ let directory = path4.resolve(toPath2(options.cwd) || "");
5084
+ const { root } = path4.parse(directory);
5085
+ const stopAt = path4.resolve(directory, options.stopAt || root);
5086
+ const limit = options.limit || Number.POSITIVE_INFINITY;
5087
+ const paths = [name].flat();
5088
+ const runMatcher = async (locateOptions) => {
5089
+ if (typeof name !== "function") {
5090
+ return locatePath(paths, locateOptions);
5091
+ }
5092
+ const foundPath = await name(locateOptions.cwd);
5093
+ if (typeof foundPath === "string") {
5094
+ return locatePath([foundPath], locateOptions);
5095
+ }
5096
+ return foundPath;
5097
+ };
5098
+ const matches = [];
5099
+ while (true) {
5100
+ const foundPath = await runMatcher({ ...options, cwd: directory });
5101
+ if (foundPath === findUpStop) {
5102
+ break;
5103
+ }
5104
+ if (foundPath) {
5105
+ matches.push(path4.resolve(directory, foundPath));
5106
+ }
5107
+ if (directory === stopAt || matches.length >= limit) {
5108
+ break;
5109
+ }
5110
+ directory = path4.dirname(directory);
5111
+ }
5112
+ return matches;
5113
+ }
5114
+ function findUpMultipleSync(name, options = {}) {
5115
+ let directory = path4.resolve(toPath2(options.cwd) || "");
5116
+ const { root } = path4.parse(directory);
5117
+ const stopAt = options.stopAt || root;
5118
+ const limit = options.limit || Number.POSITIVE_INFINITY;
5119
+ const paths = [name].flat();
5120
+ const runMatcher = (locateOptions) => {
5121
+ if (typeof name !== "function") {
5122
+ return locatePathSync(paths, locateOptions);
5123
+ }
5124
+ const foundPath = name(locateOptions.cwd);
5125
+ if (typeof foundPath === "string") {
5126
+ return locatePathSync([foundPath], locateOptions);
5127
+ }
5128
+ return foundPath;
5129
+ };
5130
+ const matches = [];
5131
+ while (true) {
5132
+ const foundPath = runMatcher({ ...options, cwd: directory });
5133
+ if (foundPath === findUpStop) {
5134
+ break;
5135
+ }
5136
+ if (foundPath) {
5137
+ matches.push(path4.resolve(directory, foundPath));
5138
+ }
5139
+ if (directory === stopAt || matches.length >= limit) {
5140
+ break;
5141
+ }
5142
+ directory = path4.dirname(directory);
5143
+ }
5144
+ return matches;
5145
+ }
5146
+ async function findUp(name, options = {}) {
5147
+ const matches = await findUpMultiple(name, { ...options, limit: 1 });
5148
+ return matches[0];
5149
+ }
5150
+ function findUpSync(name, options = {}) {
5151
+ const matches = findUpMultipleSync(name, { ...options, limit: 1 });
5152
+ return matches[0];
5153
+ }
1812
5154
  var _cache2, _cwd, _SLASHES, _match, match_fn;
1813
5155
  var _PackageManager = class _PackageManager {
1814
5156
  constructor(workspace) {
@@ -1832,17 +5174,17 @@ var _PackageManager = class _PackageManager {
1832
5174
  }
1833
5175
  return directory;
1834
5176
  }
1835
- getLocation(path3) {
1836
- let location = path3;
5177
+ getLocation(path5) {
5178
+ let location = path5;
1837
5179
  if (__privateGet(this, _cwd)) {
1838
5180
  const require2 = mod.createRequire(this.normalizeDirectory(__privateGet(this, _cwd)));
1839
- location = require2.resolve(path3);
5181
+ location = require2.resolve(path5);
1840
5182
  }
1841
5183
  return location;
1842
5184
  }
1843
- async import(path3) {
5185
+ async import(path5) {
1844
5186
  try {
1845
- let location = this.getLocation(path3);
5187
+ let location = this.getLocation(path5);
1846
5188
  if (os.platform() == "win32") {
1847
5189
  location = pathToFileURL(location).href;
1848
5190
  }
@@ -1938,13 +5280,9 @@ match_fn = function(packageJSON, dependency) {
1938
5280
  __privateAdd(_PackageManager, _cache2, {});
1939
5281
  var PackageManager = _PackageManager;
1940
5282
 
1941
- // src/SchemaGenerator.ts
1942
- var SchemaGenerator = class extends Generator {
1943
- };
1944
-
1945
5283
  // src/index.ts
1946
5284
  var src_default = build;
1947
5285
 
1948
- export { FileManager, Generator, KubbFile, PackageManager, PluginManager, PromiseManager, SchemaGenerator, ValidationPluginError, Warning, build, combineExports, combineImports, createPlugin, src_default as default, defineConfig, isInputPath, pluginName as name, pluginName, safeBuild };
5286
+ export { FileManager, Generator, KubbFile, PackageManager, PluginManager, PromiseManager, Warning, build, createPlugin, src_default as default, defineConfig, isInputPath, pluginName as name, pluginName, safeBuild };
1949
5287
  //# sourceMappingURL=out.js.map
1950
5288
  //# sourceMappingURL=index.js.map