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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/dist/chunk-56YH3VX6.js +239 -0
  2. package/dist/chunk-56YH3VX6.js.map +1 -0
  3. package/dist/chunk-6N4JBFFS.js +79 -0
  4. package/dist/chunk-6N4JBFFS.js.map +1 -0
  5. package/dist/chunk-72O327DC.cjs +247 -0
  6. package/dist/chunk-72O327DC.cjs.map +1 -0
  7. package/dist/chunk-77QZQ377.cjs +155 -0
  8. package/dist/chunk-77QZQ377.cjs.map +1 -0
  9. package/dist/chunk-ABFPJZJL.cjs +131 -0
  10. package/dist/chunk-ABFPJZJL.cjs.map +1 -0
  11. package/dist/chunk-FOQFLMOC.js +2336 -0
  12. package/dist/chunk-FOQFLMOC.js.map +1 -0
  13. package/dist/chunk-I7UUR5MZ.cjs +91 -0
  14. package/dist/chunk-I7UUR5MZ.cjs.map +1 -0
  15. package/dist/chunk-L6F5QUH2.js +129 -0
  16. package/dist/chunk-L6F5QUH2.js.map +1 -0
  17. package/dist/chunk-PY7I7OEN.cjs +92 -0
  18. package/dist/chunk-PY7I7OEN.cjs.map +1 -0
  19. package/dist/chunk-SX2AYX5F.js +18 -0
  20. package/dist/chunk-SX2AYX5F.js.map +1 -0
  21. package/dist/chunk-WFDR7OMY.js +148 -0
  22. package/dist/chunk-WFDR7OMY.js.map +1 -0
  23. package/dist/chunk-Z7XZQBAK.cjs +2339 -0
  24. package/dist/chunk-Z7XZQBAK.cjs.map +1 -0
  25. package/dist/fs.cjs +19 -2372
  26. package/dist/fs.cjs.map +1 -1
  27. package/dist/fs.js +3 -2373
  28. package/dist/fs.js.map +1 -1
  29. package/dist/index.cjs +219 -3118
  30. package/dist/index.cjs.map +1 -1
  31. package/dist/index.d.cts +0 -1
  32. package/dist/index.d.ts +0 -1
  33. package/dist/index.js +55 -3245
  34. package/dist/index.js.map +1 -1
  35. package/dist/logger.cjs +16 -81
  36. package/dist/logger.cjs.map +1 -1
  37. package/dist/logger.d.cts +2 -3
  38. package/dist/logger.d.ts +2 -3
  39. package/dist/logger.js +2 -73
  40. package/dist/logger.js.map +1 -1
  41. package/dist/transformers.cjs +40 -138
  42. package/dist/transformers.cjs.map +1 -1
  43. package/dist/transformers.js +14 -126
  44. package/dist/transformers.js.map +1 -1
  45. package/dist/utils.cjs +29 -461
  46. package/dist/utils.cjs.map +1 -1
  47. package/dist/utils.js +10 -453
  48. package/dist/utils.js.map +1 -1
  49. package/package.json +7 -7
  50. package/src/BarrelManager.ts +3 -3
  51. package/src/FileManager.ts +6 -5
  52. package/src/build.ts +8 -8
  53. package/src/logger.ts +6 -8
  54. package/src/plugin.ts +1 -1
  55. package/src/transformers/casing.ts +3 -3
  56. package/src/utils/FunctionParams.ts +2 -2
  57. package/src/utils/URLPath.ts +5 -5
package/dist/index.js CHANGED
@@ -1,2304 +1,22 @@
1
1
  import mod, { createRequire } from 'module';
2
- import pc2 from 'picocolors';
3
- import path4, { resolve, dirname, extname, relative, basename } from 'path';
4
- import { switcher } from 'js-runtime';
5
- import { camelCase as camelCase$1, camelCaseTransformMerge, pascalCase as pascalCase$1, pascalCaseTransformMerge } from 'change-case';
6
- import crypto2 from 'crypto';
2
+ import { transformReservedWord, trimExtName, searchAndReplace } from './chunk-L6F5QUH2.js';
3
+ import { EventEmitter, Queue, setUniqueName, timeout, URLPath } from './chunk-56YH3VX6.js';
4
+ import './chunk-SX2AYX5F.js';
5
+ import { LogLevel, createLogger, p, randomCliColour } from './chunk-WFDR7OMY.js';
6
+ import { write, read, getRelativePath, clean } from './chunk-FOQFLMOC.js';
7
+ import { __commonJS, init_esm_shims, __toESM, __privateAdd, __privateSet, __privateGet, __privateMethod, __require } from './chunk-6N4JBFFS.js';
8
+ import crypto from 'crypto';
9
+ import path, { resolve, extname } from 'path';
7
10
  import { print } from '@kubb/parser';
8
11
  import * as factory from '@kubb/parser/factory';
9
12
  import { orderBy } from 'natural-orderby';
10
13
  import dirTree from 'directory-tree';
11
- import seedrandom from 'seedrandom';
12
- import { EventEmitter as EventEmitter$1 } from 'events';
13
- import { performance } from 'perf_hooks';
14
14
  import os from 'os';
15
- import { pathToFileURL, fileURLToPath } from 'url';
16
- import process2 from 'process';
17
- import fs3, { promises } from 'fs';
15
+ import { pathToFileURL } from 'url';
16
+ import { findUp, findUpSync } from 'find-up';
18
17
  import { coerce, satisfies } from 'semver';
19
18
 
20
- const require = createRequire(import.meta.url);
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;
29
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
30
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
31
- }) : x)(function(x) {
32
- if (typeof require !== "undefined")
33
- return require.apply(this, arguments);
34
- throw Error('Dynamic require of "' + x + '" is not supported');
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
- };
62
- var __accessCheck = (obj, member, msg) => {
63
- if (!member.has(obj))
64
- throw TypeError("Cannot " + msg);
65
- };
66
- var __privateGet = (obj, member, getter) => {
67
- __accessCheck(obj, member, "read from private field");
68
- return getter ? getter.call(obj) : member.get(obj);
69
- };
70
- var __privateAdd = (obj, member, value) => {
71
- if (member.has(obj))
72
- throw TypeError("Cannot add the same private member more than once");
73
- member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
74
- };
75
- var __privateSet = (obj, member, value, setter) => {
76
- __accessCheck(obj, member, "write to private field");
77
- setter ? setter.call(obj, value) : member.set(obj, value);
78
- return value;
79
- };
80
- var __privateWrapper = (obj, member, setter, getter) => ({
81
- set _(value) {
82
- __privateSet(obj, member, value, setter);
83
- },
84
- get _() {
85
- return __privateGet(obj, member, getter);
86
- }
87
- });
88
- var __privateMethod = (obj, member, method) => {
89
- __accessCheck(obj, member, "access private method");
90
- return method;
91
- };
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) {
145
- }
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
- });
19
+ createRequire(import.meta.url);
2302
20
 
2303
21
  // ../../node_modules/.pnpm/lodash.isequal@4.5.0/node_modules/lodash.isequal/index.js
2304
22
  var require_lodash = __commonJS({
@@ -2437,14 +155,14 @@ var require_lodash = __commonJS({
2437
155
  var reIsNative = RegExp(
2438
156
  "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
2439
157
  );
2440
- var Buffer2 = moduleExports ? root.Buffer : void 0;
2441
- var Symbol2 = root.Symbol;
2442
- var Uint8Array2 = root.Uint8Array;
158
+ var Buffer = moduleExports ? root.Buffer : void 0;
159
+ var Symbol = root.Symbol;
160
+ var Uint8Array = root.Uint8Array;
2443
161
  var propertyIsEnumerable = objectProto.propertyIsEnumerable;
2444
162
  var splice = arrayProto.splice;
2445
- var symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0;
163
+ var symToStringTag = Symbol ? Symbol.toStringTag : void 0;
2446
164
  var nativeGetSymbols = Object.getOwnPropertySymbols;
2447
- var nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0;
165
+ var nativeIsBuffer = Buffer ? Buffer.isBuffer : void 0;
2448
166
  var nativeKeys = overArg(Object.keys, Object);
2449
167
  var DataView = getNative(root, "DataView");
2450
168
  var Map2 = getNative(root, "Map");
@@ -2457,7 +175,7 @@ var require_lodash = __commonJS({
2457
175
  var promiseCtorString = toSource(Promise2);
2458
176
  var setCtorString = toSource(Set2);
2459
177
  var weakMapCtorString = toSource(WeakMap2);
2460
- var symbolProto = Symbol2 ? Symbol2.prototype : void 0;
178
+ var symbolProto = Symbol ? Symbol.prototype : void 0;
2461
179
  var symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
2462
180
  function Hash(entries) {
2463
181
  var index = -1, length = entries == null ? 0 : entries.length;
@@ -2787,7 +505,7 @@ var require_lodash = __commonJS({
2787
505
  object = object.buffer;
2788
506
  other = other.buffer;
2789
507
  case arrayBufferTag:
2790
- if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) {
508
+ if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
2791
509
  return false;
2792
510
  }
2793
511
  return true;
@@ -3008,374 +726,6 @@ init_esm_shims();
3008
726
  // src/build.ts
3009
727
  init_esm_shims();
3010
728
 
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);
3016
- }
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();
3025
- }
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 || ""}`);
3031
- }
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)));
3036
- }
3037
- return `./${slashedPath.replace(basename(slashedPath), basename(slashedPath, extname(filePath)))}`;
3038
- }
3039
- var reader = switcher(
3040
- {
3041
- node: async (path5) => {
3042
- return import_fs_extra2.default.readFile(path5, { encoding: "utf8" });
3043
- },
3044
- bun: async (path5) => {
3045
- const file = Bun.file(path5);
3046
- return file.text();
3047
- }
3048
- },
3049
- "node"
3050
- );
3051
- switcher(
3052
- {
3053
- node: (path5) => {
3054
- return import_fs_extra2.default.readFileSync(path5, { encoding: "utf8" });
3055
- },
3056
- bun: () => {
3057
- throw new Error("Bun cannot read sync");
3058
- }
3059
- },
3060
- "node"
3061
- );
3062
- async function read(path5) {
3063
- return reader(path5);
3064
- }
3065
-
3066
- // src/utils/URLPath.ts
3067
- init_esm_shims();
3068
-
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 });
3079
- }
3080
-
3081
- // src/transformers/combineCodes.ts
3082
- init_esm_shims();
3083
- function combineCodes(codes) {
3084
- return codes.join("\n");
3085
- }
3086
-
3087
- // src/transformers/createJSDocBlockText.ts
3088
- init_esm_shims();
3089
- function createJSDocBlockText({ comments }) {
3090
- const filteredComments = comments.filter(Boolean);
3091
- if (!filteredComments.length) {
3092
- return "";
3093
- }
3094
- return `/**
3095
- * ${filteredComments.join("\n * ")}
3096
- */`;
3097
- }
3098
-
3099
- // src/transformers/escape.ts
3100
- init_esm_shims();
3101
- function escape(text) {
3102
- return text ? text.replaceAll("`", "\\`") : "";
3103
- }
3104
- function jsStringEscape(input) {
3105
- return `${input}`.replace(/["'\\\n\r\u2028\u2029]/g, (character) => {
3106
- switch (character) {
3107
- case '"':
3108
- case "'":
3109
- case "\\":
3110
- return "\\" + character;
3111
- case "\n":
3112
- return "\\n";
3113
- case "\r":
3114
- return "\\r";
3115
- case "\u2028":
3116
- return "\\u2028";
3117
- case "\u2029":
3118
- return "\\u2029";
3119
- default:
3120
- return "";
3121
- }
3122
- });
3123
- }
3124
-
3125
- // src/transformers/indent.ts
3126
- init_esm_shims();
3127
- function createIndent(size) {
3128
- return Array.from({ length: size + 1 }).join(" ");
3129
- }
3130
-
3131
- // src/transformers/nameSorter.ts
3132
- init_esm_shims();
3133
- function nameSorter(a, b) {
3134
- if (a.name < b.name) {
3135
- return -1;
3136
- }
3137
- if (a.name > b.name) {
3138
- return 1;
3139
- }
3140
- return 0;
3141
- }
3142
-
3143
- // src/transformers/searchAndReplace.ts
3144
- init_esm_shims();
3145
- function searchAndReplace(options) {
3146
- const { text, replaceBy, prefix = "", key } = options;
3147
- const searchValues = options.searchValues?.(prefix, key) || [
3148
- `${prefix}["${key}"]`,
3149
- `${prefix}['${key}']`,
3150
- `${prefix}[\`${key}\`]`,
3151
- `${prefix}"${key}"`,
3152
- `${prefix}'${key}'`,
3153
- `${prefix}\`${key}\``,
3154
- new RegExp(`${prefix}${key}`, "g")
3155
- ];
3156
- return searchValues.reduce((prev, searchValue) => {
3157
- return prev.toString().replaceAll(searchValue, replaceBy);
3158
- }, text);
3159
- }
3160
-
3161
- // src/transformers/transformReservedWord.ts
3162
- init_esm_shims();
3163
- var reservedWords = [
3164
- "abstract",
3165
- "arguments",
3166
- "boolean",
3167
- "break",
3168
- "byte",
3169
- "case",
3170
- "catch",
3171
- "char",
3172
- "class",
3173
- "const",
3174
- "continue",
3175
- "debugger",
3176
- "default",
3177
- "delete",
3178
- "do",
3179
- "double",
3180
- "else",
3181
- "enum",
3182
- "eval",
3183
- "export",
3184
- "extends",
3185
- "false",
3186
- "final",
3187
- "finally",
3188
- "float",
3189
- "for",
3190
- "function",
3191
- "goto",
3192
- "if",
3193
- "implements",
3194
- "import",
3195
- "in",
3196
- "instanceof",
3197
- "int",
3198
- "interface",
3199
- "let",
3200
- "long",
3201
- "native",
3202
- "new",
3203
- "null",
3204
- "package",
3205
- "private",
3206
- "protected",
3207
- "public",
3208
- "return",
3209
- "short",
3210
- "static",
3211
- "super",
3212
- "switch",
3213
- "synchronized",
3214
- "this",
3215
- "throw",
3216
- "throws",
3217
- "transient",
3218
- "true",
3219
- "try",
3220
- "typeof",
3221
- "var",
3222
- "void",
3223
- "volatile",
3224
- "while",
3225
- "with",
3226
- "yield",
3227
- "Array",
3228
- "Date",
3229
- "eval",
3230
- "function",
3231
- "hasOwnProperty",
3232
- "Infinity",
3233
- "isFinite",
3234
- "isNaN",
3235
- "isPrototypeOf",
3236
- "length",
3237
- "Math",
3238
- "name",
3239
- "NaN",
3240
- "Number",
3241
- "Object",
3242
- "prototype",
3243
- "String",
3244
- "toString",
3245
- "undefined",
3246
- "valueOf"
3247
- ];
3248
- function transformReservedWord(word) {
3249
- if (word && reservedWords.includes(word) || word?.match(/^\d/)) {
3250
- return `_${word}`;
3251
- }
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
- };
3378
-
3379
729
  // src/config.ts
3380
730
  init_esm_shims();
3381
731
  function defineConfig(options) {
@@ -3389,80 +739,6 @@ function isInputPath(result) {
3389
739
  init_esm_shims();
3390
740
  var import_lodash = __toESM(require_lodash(), 1);
3391
741
 
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 });
3398
- }
3399
- var writer = switcher(
3400
- {
3401
- node: async (path5, data) => {
3402
- try {
3403
- await import_fs_extra3.default.stat(resolve(path5));
3404
- const oldContent = await import_fs_extra3.default.readFile(resolve(path5), { encoding: "utf-8" });
3405
- if (oldContent?.toString() === data?.toString()) {
3406
- return;
3407
- }
3408
- } catch (_err) {
3409
- }
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" });
3413
- if (savedData?.toString() !== data?.toString()) {
3414
- throw new Error(`Sanity check failed for ${path5}
3415
-
3416
- Data[${data.length}]:
3417
- ${data}
3418
-
3419
- Saved[${savedData.length}]:
3420
- ${savedData}
3421
- `);
3422
- }
3423
- return savedData;
3424
- },
3425
- bun: async (path5, data) => {
3426
- try {
3427
- await saveCreateDirectory(path5);
3428
- await Bun.write(resolve(path5), data);
3429
- const file = Bun.file(resolve(path5));
3430
- const savedData = await file.text();
3431
- if (savedData?.toString() !== data?.toString()) {
3432
- throw new Error(`Sanity check failed for ${path5}
3433
-
3434
- Data[${data.length}]:
3435
- ${data}
3436
-
3437
- Saved[${savedData.length}]:
3438
- ${savedData}
3439
- `);
3440
- }
3441
- return savedData;
3442
- } catch (e) {
3443
- console.log(e, resolve(path5));
3444
- }
3445
- }
3446
- },
3447
- "node"
3448
- );
3449
- async function write(data, path5) {
3450
- if (data.trim() === "") {
3451
- return void 0;
3452
- }
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
- });
3464
- }
3465
-
3466
742
  // src/BarrelManager.ts
3467
743
  init_esm_shims();
3468
744
 
@@ -3530,10 +806,10 @@ var TreeNode = class _TreeNode {
3530
806
  }
3531
807
  return this;
3532
808
  }
3533
- static build(path5, options = {}) {
809
+ static build(path3, options = {}) {
3534
810
  try {
3535
811
  const exclude = Array.isArray(options.exclude) ? options.exclude : [options.exclude].filter(Boolean);
3536
- const filteredTree = dirTree(path5, { extensions: options.extensions, exclude: [/node_modules/, ...exclude] });
812
+ const filteredTree = dirTree(path3, { extensions: options.extensions, exclude: [/node_modules/, ...exclude] });
3537
813
  if (!filteredTree) {
3538
814
  return null;
3539
815
  }
@@ -3573,9 +849,9 @@ var BarrelManager = class {
3573
849
  return [];
3574
850
  }
3575
851
  if (treeNode2.children.length > 1) {
3576
- const indexPath = path4.resolve(treeNode2.data.path, "index.ts");
852
+ const indexPath = path.resolve(treeNode2.data.path, "index.ts");
3577
853
  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)}`;
854
+ const importPath = file.data.type === "directory" ? `./${file.data.name}/index` : `./${trimExtName(file.data.name)}`;
3579
855
  if (importPath.endsWith("index") && file.data.type === "file") {
3580
856
  return void 0;
3581
857
  }
@@ -3595,8 +871,8 @@ var BarrelManager = class {
3595
871
  });
3596
872
  } else if (treeNode2.children.length === 1) {
3597
873
  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)}`;
874
+ const indexPath = path.resolve(treeNode2.data.path, "index.ts");
875
+ const importPath = treeNodeChild.data.type === "directory" ? `./${treeNodeChild.data.name}/index` : `./${trimExtName(treeNodeChild.data.name)}`;
3600
876
  const exports = [
3601
877
  {
3602
878
  path: extName ? `${importPath}${extName}` : importPath,
@@ -3718,15 +994,15 @@ var _FileManager = class _FileManager {
3718
994
  });
3719
995
  return cache;
3720
996
  }
3721
- get(path5) {
3722
- return __privateGet(this, _cache).get(path5);
997
+ get(path3) {
998
+ return __privateGet(this, _cache).get(path3);
3723
999
  }
3724
- remove(path5) {
3725
- const cacheItem = this.get(path5);
1000
+ remove(path3) {
1001
+ const cacheItem = this.get(path3);
3726
1002
  if (!cacheItem) {
3727
1003
  return;
3728
1004
  }
3729
- __privateGet(this, _cache).delete(path5);
1005
+ __privateGet(this, _cache).delete(path3);
3730
1006
  }
3731
1007
  async write(...params) {
3732
1008
  if (!__privateGet(this, _isWriting)) {
@@ -3745,11 +1021,11 @@ var _FileManager = class _FileManager {
3745
1021
  static getSource(file) {
3746
1022
  return getSource(file);
3747
1023
  }
3748
- static getMode(path5) {
3749
- if (!path5) {
1024
+ static getMode(path3) {
1025
+ if (!path3) {
3750
1026
  return "directory";
3751
1027
  }
3752
- return extname(path5) ? "file" : "directory";
1028
+ return extname(path3) ? "file" : "directory";
3753
1029
  }
3754
1030
  static get extensions() {
3755
1031
  return [".js", ".ts", ".tsx"];
@@ -3767,7 +1043,7 @@ _validate = new WeakSet();
3767
1043
  _add = new WeakSet();
3768
1044
  add_fn = async function(file) {
3769
1045
  const controller = new AbortController();
3770
- const resolvedFile = { id: crypto2.randomUUID(), name: transformers_default.trimExtName(file.baseName), ...file };
1046
+ const resolvedFile = { id: crypto.randomUUID(), name: trimExtName(file.baseName), ...file };
3771
1047
  __privateGet(this, _cache).set(resolvedFile.path, [{ cancel: () => controller.abort(), ...resolvedFile }]);
3772
1048
  if (__privateGet(this, _queue)) {
3773
1049
  await __privateGet(this, _queue).run(
@@ -3805,7 +1081,7 @@ function getSource(file) {
3805
1081
  const exports = file.exports ? combineExports(file.exports) : [];
3806
1082
  const imports = file.imports ? combineImports(file.imports, exports, file.source) : [];
3807
1083
  const importNodes = imports.filter((item) => {
3808
- return item.path !== transformers_default.trimExtName(file.path);
1084
+ return item.path !== trimExtName(file.path);
3809
1085
  }).map((item) => {
3810
1086
  return factory.createImportDeclaration({
3811
1087
  name: item.name,
@@ -3911,196 +1187,17 @@ function getEnvSource(source, env) {
3911
1187
  throw new TypeError(`Environment should be in upperCase for ${key}`);
3912
1188
  }
3913
1189
  if (typeof replaceBy === "string") {
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).*
1190
+ prev = searchAndReplace({ text: prev.replaceAll(`process.env.${key}`, replaceBy), replaceBy, prefix: "process.env", key });
1191
+ prev = searchAndReplace({ text: prev.replaceAll(new RegExp(`(declare const).*
3916
1192
  `, "ig"), ""), replaceBy, key });
3917
1193
  }
3918
1194
  return prev;
3919
1195
  }, source);
3920
1196
  }
3921
1197
 
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
1198
  // src/PluginManager.ts
3994
1199
  init_esm_shims();
3995
1200
 
3996
- // src/utils/EventEmitter.ts
3997
- init_esm_shims();
3998
- var _emitter;
3999
- var EventEmitter = class {
4000
- constructor() {
4001
- __privateAdd(this, _emitter, new EventEmitter$1());
4002
- __privateGet(this, _emitter).setMaxListeners(100);
4003
- }
4004
- emit(eventName, ...eventArg) {
4005
- __privateGet(this, _emitter).emit(eventName, ...eventArg);
4006
- }
4007
- on(eventName, handler) {
4008
- __privateGet(this, _emitter).on(eventName, handler);
4009
- }
4010
- off(eventName, handler) {
4011
- __privateGet(this, _emitter).off(eventName, handler);
4012
- }
4013
- removeAll() {
4014
- __privateGet(this, _emitter).removeAllListeners();
4015
- }
4016
- };
4017
- _emitter = new WeakMap();
4018
-
4019
- // src/utils/Queue.ts
4020
- init_esm_shims();
4021
- var _queue2, _workerCount, _maxParallel, _debug, _work, work_fn;
4022
- var Queue = class {
4023
- constructor(maxParallel, debug = false) {
4024
- __privateAdd(this, _work);
4025
- __privateAdd(this, _queue2, []);
4026
- this.eventEmitter = new EventEmitter();
4027
- __privateAdd(this, _workerCount, 0);
4028
- __privateAdd(this, _maxParallel, void 0);
4029
- __privateAdd(this, _debug, false);
4030
- __privateSet(this, _maxParallel, maxParallel);
4031
- __privateSet(this, _debug, debug);
4032
- }
4033
- run(job, options = { controller: new AbortController(), name: crypto2.randomUUID(), description: "" }) {
4034
- return new Promise((resolve3, reject) => {
4035
- const item = { reject, resolve: resolve3, job, name: options.name, description: options.description || options.name };
4036
- options.controller?.signal.addEventListener("abort", () => {
4037
- __privateSet(this, _queue2, __privateGet(this, _queue2).filter((queueItem) => queueItem.name === item.name));
4038
- reject("Aborted");
4039
- });
4040
- __privateGet(this, _queue2).push(item);
4041
- __privateMethod(this, _work, work_fn).call(this);
4042
- });
4043
- }
4044
- runSync(job, options = { controller: new AbortController(), name: crypto2.randomUUID(), description: "" }) {
4045
- new Promise((resolve3, reject) => {
4046
- const item = { reject, resolve: resolve3, job, name: options.name, description: options.description || options.name };
4047
- options.controller?.signal.addEventListener("abort", () => {
4048
- __privateSet(this, _queue2, __privateGet(this, _queue2).filter((queueItem) => queueItem.name === item.name));
4049
- });
4050
- __privateGet(this, _queue2).push(item);
4051
- __privateMethod(this, _work, work_fn).call(this);
4052
- });
4053
- }
4054
- get hasJobs() {
4055
- return __privateGet(this, _workerCount) > 0 || __privateGet(this, _queue2).length > 0;
4056
- }
4057
- get count() {
4058
- return __privateGet(this, _workerCount);
4059
- }
4060
- };
4061
- _queue2 = new WeakMap();
4062
- _workerCount = new WeakMap();
4063
- _maxParallel = new WeakMap();
4064
- _debug = new WeakMap();
4065
- _work = new WeakSet();
4066
- work_fn = function() {
4067
- if (__privateGet(this, _workerCount) >= __privateGet(this, _maxParallel)) {
4068
- return;
4069
- }
4070
- __privateWrapper(this, _workerCount)._++;
4071
- let entry;
4072
- while (entry = __privateGet(this, _queue2).shift()) {
4073
- const { reject, resolve: resolve3, job, name, description } = entry;
4074
- if (__privateGet(this, _debug)) {
4075
- performance.mark(name + "_start");
4076
- }
4077
- job().then((result) => {
4078
- this.eventEmitter.emit("jobDone", result);
4079
- resolve3(result);
4080
- if (__privateGet(this, _debug)) {
4081
- performance.mark(name + "_stop");
4082
- performance.measure(description, name + "_start", name + "_stop");
4083
- }
4084
- }).catch((err) => {
4085
- this.eventEmitter.emit("jobFailed", err);
4086
- reject(err);
4087
- });
4088
- }
4089
- __privateWrapper(this, _workerCount)._--;
4090
- };
4091
-
4092
- // src/utils/uniqueName.ts
4093
- init_esm_shims();
4094
- function setUniqueName(originalName, data) {
4095
- let used = data[originalName] || 0;
4096
- if (used) {
4097
- data[originalName] = ++used;
4098
- return originalName;
4099
- }
4100
- data[originalName] = 1;
4101
- return originalName;
4102
- }
4103
-
4104
1201
  // src/errors.ts
4105
1202
  init_esm_shims();
4106
1203
  var Warning = class extends Error {
@@ -4184,8 +1281,8 @@ var definePlugin = createPlugin((options) => {
4184
1281
  };
4185
1282
  },
4186
1283
  resolvePath(baseName) {
4187
- const root = path4.resolve(this.config.root, this.config.output.path);
4188
- return path4.resolve(root, baseName);
1284
+ const root = path.resolve(this.config.root, this.config.output.path);
1285
+ return path.resolve(root, baseName);
4189
1286
  },
4190
1287
  resolveName(name) {
4191
1288
  return name;
@@ -4717,7 +1814,7 @@ async function setup(options) {
4717
1814
  } catch (e) {
4718
1815
  if (isInputPath(config)) {
4719
1816
  throw new Error(
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),
1817
+ "Cannot read file/URL defined in `input.path` or set with `kubb generate PATH` in the CLI of your Kubb config " + p.dim(config.input.path),
4721
1818
  {
4722
1819
  cause: e
4723
1820
  }
@@ -4728,11 +1825,11 @@ async function setup(options) {
4728
1825
  await clean(config.output.path);
4729
1826
  }
4730
1827
  const queueTask = async (file) => {
4731
- const { path: path5 } = file;
1828
+ const { path: path3 } = file;
4732
1829
  let code = FileManager.getSource(file);
4733
1830
  const { result: loadedResult } = await pluginManager.hookFirst({
4734
1831
  hookName: "load",
4735
- parameters: [path5]
1832
+ parameters: [path3]
4736
1833
  });
4737
1834
  if (loadedResult && isPromise(loadedResult)) {
4738
1835
  code = await loadedResult;
@@ -4743,7 +1840,7 @@ async function setup(options) {
4743
1840
  if (code) {
4744
1841
  const transformedCode = await pluginManager.hookReduceArg0({
4745
1842
  hookName: "transform",
4746
- parameters: [code, path5],
1843
+ parameters: [code, path3],
4747
1844
  reduce: transformReducer
4748
1845
  });
4749
1846
  if (config.output.write || config.output.write === void 0) {
@@ -4751,12 +1848,12 @@ async function setup(options) {
4751
1848
  return pluginManager.hookForPlugin({
4752
1849
  pluginKey: file.meta?.pluginKey,
4753
1850
  hookName: "writeFile",
4754
- parameters: [transformedCode, path5]
1851
+ parameters: [transformedCode, path3]
4755
1852
  });
4756
1853
  }
4757
1854
  return pluginManager.hookFirst({
4758
1855
  hookName: "writeFile",
4759
- parameters: [transformedCode, path5]
1856
+ parameters: [transformedCode, path3]
4760
1857
  });
4761
1858
  }
4762
1859
  }
@@ -4770,7 +1867,7 @@ async function setup(options) {
4770
1867
  logger.spinner.start(`\u{1F4BE} Writing`);
4771
1868
  }
4772
1869
  if (logger.logLevel === LogLevel.debug) {
4773
- logger.info(`PluginKey ${pc2.dim(JSON.stringify(plugin.key))}
1870
+ logger.info(`PluginKey ${p.dim(JSON.stringify(plugin.key))}
4774
1871
  with source
4775
1872
 
4776
1873
  ${code}`);
@@ -4779,11 +1876,11 @@ ${code}`);
4779
1876
  });
4780
1877
  pluginManager.on("executed", (executer) => {
4781
1878
  const { hookName, plugin, output, parameters } = executer;
4782
- const messsage = `${randomPicoColour(plugin.name)} Executing ${hookName}`;
1879
+ const messsage = `${randomCliColour(plugin.name)} Executing ${hookName}`;
4783
1880
  if (logger.logLevel === LogLevel.info && logger.spinner) {
4784
1881
  if (hookName === "writeFile") {
4785
- const [_code, path5] = parameters;
4786
- logger.spinner.suffixText = pc2.dim(path5);
1882
+ const [_code, path3] = parameters;
1883
+ logger.spinner.suffixText = p.dim(path3);
4787
1884
  } else {
4788
1885
  logger.spinner.suffixText = messsage;
4789
1886
  }
@@ -4791,9 +1888,9 @@ ${code}`);
4791
1888
  if (logger.logLevel === LogLevel.debug) {
4792
1889
  logger.info(messsage);
4793
1890
  const logs = [
4794
- parameters && `${pc2.bgWhite(`Parameters`)} ${randomPicoColour(plugin.name)} ${hookName}`,
1891
+ parameters && `${p.bgWhite(`Parameters`)} ${randomCliColour(plugin.name)} ${hookName}`,
4795
1892
  JSON.stringify(parameters, void 0, 2),
4796
- output && `${pc2.bgWhite("Output")} ${randomPicoColour(plugin.name)} ${hookName}`,
1893
+ output && `${p.bgWhite("Output")} ${randomCliColour(plugin.name)} ${hookName}`,
4797
1894
  output
4798
1895
  ].filter(Boolean);
4799
1896
  console.log(logs.join("\n"));
@@ -4864,293 +1961,6 @@ _context = new WeakMap();
4864
1961
 
4865
1962
  // src/PackageManager.ts
4866
1963
  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
- }
5154
1964
  var _cache2, _cwd, _SLASHES, _match, match_fn;
5155
1965
  var _PackageManager = class _PackageManager {
5156
1966
  constructor(workspace) {
@@ -5174,17 +1984,17 @@ var _PackageManager = class _PackageManager {
5174
1984
  }
5175
1985
  return directory;
5176
1986
  }
5177
- getLocation(path5) {
5178
- let location = path5;
1987
+ getLocation(path3) {
1988
+ let location = path3;
5179
1989
  if (__privateGet(this, _cwd)) {
5180
1990
  const require2 = mod.createRequire(this.normalizeDirectory(__privateGet(this, _cwd)));
5181
- location = require2.resolve(path5);
1991
+ location = require2.resolve(path3);
5182
1992
  }
5183
1993
  return location;
5184
1994
  }
5185
- async import(path5) {
1995
+ async import(path3) {
5186
1996
  try {
5187
- let location = this.getLocation(path5);
1997
+ let location = this.getLocation(path3);
5188
1998
  if (os.platform() == "win32") {
5189
1999
  location = pathToFileURL(location).href;
5190
2000
  }