@vixt/react 0.11.2 → 0.12.1

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.
@@ -1,1930 +0,0 @@
1
- import { n as __require, t as __commonJSMin } from "./chunk-DnnnRqeS.mjs";
2
- //#region ../../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js
3
- var require_universalify = /* @__PURE__ */ __commonJSMin(((exports) => {
4
- exports.fromCallback = function(fn) {
5
- return Object.defineProperty(function(...args) {
6
- if (typeof args[args.length - 1] === "function") fn.apply(this, args);
7
- else return new Promise((resolve, reject) => {
8
- args.push((err, res) => err != null ? reject(err) : resolve(res));
9
- fn.apply(this, args);
10
- });
11
- }, "name", { value: fn.name });
12
- };
13
- exports.fromPromise = function(fn) {
14
- return Object.defineProperty(function(...args) {
15
- const cb = args[args.length - 1];
16
- if (typeof cb !== "function") return fn.apply(this, args);
17
- else {
18
- args.pop();
19
- fn.apply(this, args).then((r) => cb(null, r), cb);
20
- }
21
- }, "name", { value: fn.name });
22
- };
23
- }));
24
- //#endregion
25
- //#region ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js
26
- var require_polyfills = /* @__PURE__ */ __commonJSMin(((exports, module) => {
27
- var constants = __require("constants");
28
- var origCwd = process.cwd;
29
- var cwd = null;
30
- var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform;
31
- process.cwd = function() {
32
- if (!cwd) cwd = origCwd.call(process);
33
- return cwd;
34
- };
35
- try {
36
- process.cwd();
37
- } catch (er) {}
38
- if (typeof process.chdir === "function") {
39
- var chdir = process.chdir;
40
- process.chdir = function(d) {
41
- cwd = null;
42
- chdir.call(process, d);
43
- };
44
- if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir);
45
- }
46
- module.exports = patch;
47
- function patch(fs) {
48
- if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) patchLchmod(fs);
49
- if (!fs.lutimes) patchLutimes(fs);
50
- fs.chown = chownFix(fs.chown);
51
- fs.fchown = chownFix(fs.fchown);
52
- fs.lchown = chownFix(fs.lchown);
53
- fs.chmod = chmodFix(fs.chmod);
54
- fs.fchmod = chmodFix(fs.fchmod);
55
- fs.lchmod = chmodFix(fs.lchmod);
56
- fs.chownSync = chownFixSync(fs.chownSync);
57
- fs.fchownSync = chownFixSync(fs.fchownSync);
58
- fs.lchownSync = chownFixSync(fs.lchownSync);
59
- fs.chmodSync = chmodFixSync(fs.chmodSync);
60
- fs.fchmodSync = chmodFixSync(fs.fchmodSync);
61
- fs.lchmodSync = chmodFixSync(fs.lchmodSync);
62
- fs.stat = statFix(fs.stat);
63
- fs.fstat = statFix(fs.fstat);
64
- fs.lstat = statFix(fs.lstat);
65
- fs.statSync = statFixSync(fs.statSync);
66
- fs.fstatSync = statFixSync(fs.fstatSync);
67
- fs.lstatSync = statFixSync(fs.lstatSync);
68
- if (fs.chmod && !fs.lchmod) {
69
- fs.lchmod = function(path, mode, cb) {
70
- if (cb) process.nextTick(cb);
71
- };
72
- fs.lchmodSync = function() {};
73
- }
74
- if (fs.chown && !fs.lchown) {
75
- fs.lchown = function(path, uid, gid, cb) {
76
- if (cb) process.nextTick(cb);
77
- };
78
- fs.lchownSync = function() {};
79
- }
80
- if (platform === "win32") fs.rename = typeof fs.rename !== "function" ? fs.rename : (function(fs$rename) {
81
- function rename(from, to, cb) {
82
- var start = Date.now();
83
- var backoff = 0;
84
- fs$rename(from, to, function CB(er) {
85
- if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
86
- setTimeout(function() {
87
- fs.stat(to, function(stater, st) {
88
- if (stater && stater.code === "ENOENT") fs$rename(from, to, CB);
89
- else cb(er);
90
- });
91
- }, backoff);
92
- if (backoff < 100) backoff += 10;
93
- return;
94
- }
95
- if (cb) cb(er);
96
- });
97
- }
98
- if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename);
99
- return rename;
100
- })(fs.rename);
101
- fs.read = typeof fs.read !== "function" ? fs.read : (function(fs$read) {
102
- function read(fd, buffer, offset, length, position, callback_) {
103
- var callback;
104
- if (callback_ && typeof callback_ === "function") {
105
- var eagCounter = 0;
106
- callback = function(er, _, __) {
107
- if (er && er.code === "EAGAIN" && eagCounter < 10) {
108
- eagCounter++;
109
- return fs$read.call(fs, fd, buffer, offset, length, position, callback);
110
- }
111
- callback_.apply(this, arguments);
112
- };
113
- }
114
- return fs$read.call(fs, fd, buffer, offset, length, position, callback);
115
- }
116
- if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read);
117
- return read;
118
- })(fs.read);
119
- fs.readSync = typeof fs.readSync !== "function" ? fs.readSync : (function(fs$readSync) {
120
- return function(fd, buffer, offset, length, position) {
121
- var eagCounter = 0;
122
- while (true) try {
123
- return fs$readSync.call(fs, fd, buffer, offset, length, position);
124
- } catch (er) {
125
- if (er.code === "EAGAIN" && eagCounter < 10) {
126
- eagCounter++;
127
- continue;
128
- }
129
- throw er;
130
- }
131
- };
132
- })(fs.readSync);
133
- function patchLchmod(fs) {
134
- fs.lchmod = function(path, mode, callback) {
135
- fs.open(path, constants.O_WRONLY | constants.O_SYMLINK, mode, function(err, fd) {
136
- if (err) {
137
- if (callback) callback(err);
138
- return;
139
- }
140
- fs.fchmod(fd, mode, function(err) {
141
- fs.close(fd, function(err2) {
142
- if (callback) callback(err || err2);
143
- });
144
- });
145
- });
146
- };
147
- fs.lchmodSync = function(path, mode) {
148
- var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode);
149
- var threw = true;
150
- var ret;
151
- try {
152
- ret = fs.fchmodSync(fd, mode);
153
- threw = false;
154
- } finally {
155
- if (threw) try {
156
- fs.closeSync(fd);
157
- } catch (er) {}
158
- else fs.closeSync(fd);
159
- }
160
- return ret;
161
- };
162
- }
163
- function patchLutimes(fs) {
164
- if (constants.hasOwnProperty("O_SYMLINK") && fs.futimes) {
165
- fs.lutimes = function(path, at, mt, cb) {
166
- fs.open(path, constants.O_SYMLINK, function(er, fd) {
167
- if (er) {
168
- if (cb) cb(er);
169
- return;
170
- }
171
- fs.futimes(fd, at, mt, function(er) {
172
- fs.close(fd, function(er2) {
173
- if (cb) cb(er || er2);
174
- });
175
- });
176
- });
177
- };
178
- fs.lutimesSync = function(path, at, mt) {
179
- var fd = fs.openSync(path, constants.O_SYMLINK);
180
- var ret;
181
- var threw = true;
182
- try {
183
- ret = fs.futimesSync(fd, at, mt);
184
- threw = false;
185
- } finally {
186
- if (threw) try {
187
- fs.closeSync(fd);
188
- } catch (er) {}
189
- else fs.closeSync(fd);
190
- }
191
- return ret;
192
- };
193
- } else if (fs.futimes) {
194
- fs.lutimes = function(_a, _b, _c, cb) {
195
- if (cb) process.nextTick(cb);
196
- };
197
- fs.lutimesSync = function() {};
198
- }
199
- }
200
- function chmodFix(orig) {
201
- if (!orig) return orig;
202
- return function(target, mode, cb) {
203
- return orig.call(fs, target, mode, function(er) {
204
- if (chownErOk(er)) er = null;
205
- if (cb) cb.apply(this, arguments);
206
- });
207
- };
208
- }
209
- function chmodFixSync(orig) {
210
- if (!orig) return orig;
211
- return function(target, mode) {
212
- try {
213
- return orig.call(fs, target, mode);
214
- } catch (er) {
215
- if (!chownErOk(er)) throw er;
216
- }
217
- };
218
- }
219
- function chownFix(orig) {
220
- if (!orig) return orig;
221
- return function(target, uid, gid, cb) {
222
- return orig.call(fs, target, uid, gid, function(er) {
223
- if (chownErOk(er)) er = null;
224
- if (cb) cb.apply(this, arguments);
225
- });
226
- };
227
- }
228
- function chownFixSync(orig) {
229
- if (!orig) return orig;
230
- return function(target, uid, gid) {
231
- try {
232
- return orig.call(fs, target, uid, gid);
233
- } catch (er) {
234
- if (!chownErOk(er)) throw er;
235
- }
236
- };
237
- }
238
- function statFix(orig) {
239
- if (!orig) return orig;
240
- return function(target, options, cb) {
241
- if (typeof options === "function") {
242
- cb = options;
243
- options = null;
244
- }
245
- function callback(er, stats) {
246
- if (stats) {
247
- if (stats.uid < 0) stats.uid += 4294967296;
248
- if (stats.gid < 0) stats.gid += 4294967296;
249
- }
250
- if (cb) cb.apply(this, arguments);
251
- }
252
- return options ? orig.call(fs, target, options, callback) : orig.call(fs, target, callback);
253
- };
254
- }
255
- function statFixSync(orig) {
256
- if (!orig) return orig;
257
- return function(target, options) {
258
- var stats = options ? orig.call(fs, target, options) : orig.call(fs, target);
259
- if (stats) {
260
- if (stats.uid < 0) stats.uid += 4294967296;
261
- if (stats.gid < 0) stats.gid += 4294967296;
262
- }
263
- return stats;
264
- };
265
- }
266
- function chownErOk(er) {
267
- if (!er) return true;
268
- if (er.code === "ENOSYS") return true;
269
- if (!process.getuid || process.getuid() !== 0) {
270
- if (er.code === "EINVAL" || er.code === "EPERM") return true;
271
- }
272
- return false;
273
- }
274
- }
275
- }));
276
- //#endregion
277
- //#region ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js
278
- var require_legacy_streams = /* @__PURE__ */ __commonJSMin(((exports, module) => {
279
- var Stream = __require("stream").Stream;
280
- module.exports = legacy;
281
- function legacy(fs) {
282
- return {
283
- ReadStream,
284
- WriteStream
285
- };
286
- function ReadStream(path, options) {
287
- if (!(this instanceof ReadStream)) return new ReadStream(path, options);
288
- Stream.call(this);
289
- var self = this;
290
- this.path = path;
291
- this.fd = null;
292
- this.readable = true;
293
- this.paused = false;
294
- this.flags = "r";
295
- this.mode = 438;
296
- this.bufferSize = 64 * 1024;
297
- options = options || {};
298
- var keys = Object.keys(options);
299
- for (var index = 0, length = keys.length; index < length; index++) {
300
- var key = keys[index];
301
- this[key] = options[key];
302
- }
303
- if (this.encoding) this.setEncoding(this.encoding);
304
- if (this.start !== void 0) {
305
- if ("number" !== typeof this.start) throw TypeError("start must be a Number");
306
- if (this.end === void 0) this.end = Infinity;
307
- else if ("number" !== typeof this.end) throw TypeError("end must be a Number");
308
- if (this.start > this.end) throw new Error("start must be <= end");
309
- this.pos = this.start;
310
- }
311
- if (this.fd !== null) {
312
- process.nextTick(function() {
313
- self._read();
314
- });
315
- return;
316
- }
317
- fs.open(this.path, this.flags, this.mode, function(err, fd) {
318
- if (err) {
319
- self.emit("error", err);
320
- self.readable = false;
321
- return;
322
- }
323
- self.fd = fd;
324
- self.emit("open", fd);
325
- self._read();
326
- });
327
- }
328
- function WriteStream(path, options) {
329
- if (!(this instanceof WriteStream)) return new WriteStream(path, options);
330
- Stream.call(this);
331
- this.path = path;
332
- this.fd = null;
333
- this.writable = true;
334
- this.flags = "w";
335
- this.encoding = "binary";
336
- this.mode = 438;
337
- this.bytesWritten = 0;
338
- options = options || {};
339
- var keys = Object.keys(options);
340
- for (var index = 0, length = keys.length; index < length; index++) {
341
- var key = keys[index];
342
- this[key] = options[key];
343
- }
344
- if (this.start !== void 0) {
345
- if ("number" !== typeof this.start) throw TypeError("start must be a Number");
346
- if (this.start < 0) throw new Error("start must be >= zero");
347
- this.pos = this.start;
348
- }
349
- this.busy = false;
350
- this._queue = [];
351
- if (this.fd === null) {
352
- this._open = fs.open;
353
- this._queue.push([
354
- this._open,
355
- this.path,
356
- this.flags,
357
- this.mode,
358
- void 0
359
- ]);
360
- this.flush();
361
- }
362
- }
363
- }
364
- }));
365
- //#endregion
366
- //#region ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/clone.js
367
- var require_clone = /* @__PURE__ */ __commonJSMin(((exports, module) => {
368
- module.exports = clone;
369
- var getPrototypeOf = Object.getPrototypeOf || function(obj) {
370
- return obj.__proto__;
371
- };
372
- function clone(obj) {
373
- if (obj === null || typeof obj !== "object") return obj;
374
- if (obj instanceof Object) var copy = { __proto__: getPrototypeOf(obj) };
375
- else var copy = Object.create(null);
376
- Object.getOwnPropertyNames(obj).forEach(function(key) {
377
- Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key));
378
- });
379
- return copy;
380
- }
381
- }));
382
- //#endregion
383
- //#region ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js
384
- var require_graceful_fs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
385
- var fs = __require("fs");
386
- var polyfills = require_polyfills();
387
- var legacy = require_legacy_streams();
388
- var clone = require_clone();
389
- var util = __require("util");
390
- /* istanbul ignore next - node 0.x polyfill */
391
- var gracefulQueue;
392
- var previousSymbol;
393
- /* istanbul ignore else - node 0.x polyfill */
394
- if (typeof Symbol === "function" && typeof Symbol.for === "function") {
395
- gracefulQueue = Symbol.for("graceful-fs.queue");
396
- previousSymbol = Symbol.for("graceful-fs.previous");
397
- } else {
398
- gracefulQueue = "___graceful-fs.queue";
399
- previousSymbol = "___graceful-fs.previous";
400
- }
401
- function noop() {}
402
- function publishQueue(context, queue) {
403
- Object.defineProperty(context, gracefulQueue, { get: function() {
404
- return queue;
405
- } });
406
- }
407
- var debug = noop;
408
- if (util.debuglog) debug = util.debuglog("gfs4");
409
- else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) debug = function() {
410
- var m = util.format.apply(util, arguments);
411
- m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
412
- console.error(m);
413
- };
414
- if (!fs[gracefulQueue]) {
415
- publishQueue(fs, global[gracefulQueue] || []);
416
- fs.close = (function(fs$close) {
417
- function close(fd, cb) {
418
- return fs$close.call(fs, fd, function(err) {
419
- if (!err) resetQueue();
420
- if (typeof cb === "function") cb.apply(this, arguments);
421
- });
422
- }
423
- Object.defineProperty(close, previousSymbol, { value: fs$close });
424
- return close;
425
- })(fs.close);
426
- fs.closeSync = (function(fs$closeSync) {
427
- function closeSync(fd) {
428
- fs$closeSync.apply(fs, arguments);
429
- resetQueue();
430
- }
431
- Object.defineProperty(closeSync, previousSymbol, { value: fs$closeSync });
432
- return closeSync;
433
- })(fs.closeSync);
434
- if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) process.on("exit", function() {
435
- debug(fs[gracefulQueue]);
436
- __require("assert").equal(fs[gracefulQueue].length, 0);
437
- });
438
- }
439
- if (!global[gracefulQueue]) publishQueue(global, fs[gracefulQueue]);
440
- module.exports = patch(clone(fs));
441
- if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) {
442
- module.exports = patch(fs);
443
- fs.__patched = true;
444
- }
445
- function patch(fs) {
446
- polyfills(fs);
447
- fs.gracefulify = patch;
448
- fs.createReadStream = createReadStream;
449
- fs.createWriteStream = createWriteStream;
450
- var fs$readFile = fs.readFile;
451
- fs.readFile = readFile;
452
- function readFile(path, options, cb) {
453
- if (typeof options === "function") cb = options, options = null;
454
- return go$readFile(path, options, cb);
455
- function go$readFile(path, options, cb, startTime) {
456
- return fs$readFile(path, options, function(err) {
457
- if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([
458
- go$readFile,
459
- [
460
- path,
461
- options,
462
- cb
463
- ],
464
- err,
465
- startTime || Date.now(),
466
- Date.now()
467
- ]);
468
- else if (typeof cb === "function") cb.apply(this, arguments);
469
- });
470
- }
471
- }
472
- var fs$writeFile = fs.writeFile;
473
- fs.writeFile = writeFile;
474
- function writeFile(path, data, options, cb) {
475
- if (typeof options === "function") cb = options, options = null;
476
- return go$writeFile(path, data, options, cb);
477
- function go$writeFile(path, data, options, cb, startTime) {
478
- return fs$writeFile(path, data, options, function(err) {
479
- if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([
480
- go$writeFile,
481
- [
482
- path,
483
- data,
484
- options,
485
- cb
486
- ],
487
- err,
488
- startTime || Date.now(),
489
- Date.now()
490
- ]);
491
- else if (typeof cb === "function") cb.apply(this, arguments);
492
- });
493
- }
494
- }
495
- var fs$appendFile = fs.appendFile;
496
- if (fs$appendFile) fs.appendFile = appendFile;
497
- function appendFile(path, data, options, cb) {
498
- if (typeof options === "function") cb = options, options = null;
499
- return go$appendFile(path, data, options, cb);
500
- function go$appendFile(path, data, options, cb, startTime) {
501
- return fs$appendFile(path, data, options, function(err) {
502
- if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([
503
- go$appendFile,
504
- [
505
- path,
506
- data,
507
- options,
508
- cb
509
- ],
510
- err,
511
- startTime || Date.now(),
512
- Date.now()
513
- ]);
514
- else if (typeof cb === "function") cb.apply(this, arguments);
515
- });
516
- }
517
- }
518
- var fs$copyFile = fs.copyFile;
519
- if (fs$copyFile) fs.copyFile = copyFile;
520
- function copyFile(src, dest, flags, cb) {
521
- if (typeof flags === "function") {
522
- cb = flags;
523
- flags = 0;
524
- }
525
- return go$copyFile(src, dest, flags, cb);
526
- function go$copyFile(src, dest, flags, cb, startTime) {
527
- return fs$copyFile(src, dest, flags, function(err) {
528
- if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([
529
- go$copyFile,
530
- [
531
- src,
532
- dest,
533
- flags,
534
- cb
535
- ],
536
- err,
537
- startTime || Date.now(),
538
- Date.now()
539
- ]);
540
- else if (typeof cb === "function") cb.apply(this, arguments);
541
- });
542
- }
543
- }
544
- var fs$readdir = fs.readdir;
545
- fs.readdir = readdir;
546
- var noReaddirOptionVersions = /^v[0-5]\./;
547
- function readdir(path, options, cb) {
548
- if (typeof options === "function") cb = options, options = null;
549
- var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir(path, options, cb, startTime) {
550
- return fs$readdir(path, fs$readdirCallback(path, options, cb, startTime));
551
- } : function go$readdir(path, options, cb, startTime) {
552
- return fs$readdir(path, options, fs$readdirCallback(path, options, cb, startTime));
553
- };
554
- return go$readdir(path, options, cb);
555
- function fs$readdirCallback(path, options, cb, startTime) {
556
- return function(err, files) {
557
- if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([
558
- go$readdir,
559
- [
560
- path,
561
- options,
562
- cb
563
- ],
564
- err,
565
- startTime || Date.now(),
566
- Date.now()
567
- ]);
568
- else {
569
- if (files && files.sort) files.sort();
570
- if (typeof cb === "function") cb.call(this, err, files);
571
- }
572
- };
573
- }
574
- }
575
- if (process.version.substr(0, 4) === "v0.8") {
576
- var legStreams = legacy(fs);
577
- ReadStream = legStreams.ReadStream;
578
- WriteStream = legStreams.WriteStream;
579
- }
580
- var fs$ReadStream = fs.ReadStream;
581
- if (fs$ReadStream) {
582
- ReadStream.prototype = Object.create(fs$ReadStream.prototype);
583
- ReadStream.prototype.open = ReadStream$open;
584
- }
585
- var fs$WriteStream = fs.WriteStream;
586
- if (fs$WriteStream) {
587
- WriteStream.prototype = Object.create(fs$WriteStream.prototype);
588
- WriteStream.prototype.open = WriteStream$open;
589
- }
590
- Object.defineProperty(fs, "ReadStream", {
591
- get: function() {
592
- return ReadStream;
593
- },
594
- set: function(val) {
595
- ReadStream = val;
596
- },
597
- enumerable: true,
598
- configurable: true
599
- });
600
- Object.defineProperty(fs, "WriteStream", {
601
- get: function() {
602
- return WriteStream;
603
- },
604
- set: function(val) {
605
- WriteStream = val;
606
- },
607
- enumerable: true,
608
- configurable: true
609
- });
610
- var FileReadStream = ReadStream;
611
- Object.defineProperty(fs, "FileReadStream", {
612
- get: function() {
613
- return FileReadStream;
614
- },
615
- set: function(val) {
616
- FileReadStream = val;
617
- },
618
- enumerable: true,
619
- configurable: true
620
- });
621
- var FileWriteStream = WriteStream;
622
- Object.defineProperty(fs, "FileWriteStream", {
623
- get: function() {
624
- return FileWriteStream;
625
- },
626
- set: function(val) {
627
- FileWriteStream = val;
628
- },
629
- enumerable: true,
630
- configurable: true
631
- });
632
- function ReadStream(path, options) {
633
- if (this instanceof ReadStream) return fs$ReadStream.apply(this, arguments), this;
634
- else return ReadStream.apply(Object.create(ReadStream.prototype), arguments);
635
- }
636
- function ReadStream$open() {
637
- var that = this;
638
- open(that.path, that.flags, that.mode, function(err, fd) {
639
- if (err) {
640
- if (that.autoClose) that.destroy();
641
- that.emit("error", err);
642
- } else {
643
- that.fd = fd;
644
- that.emit("open", fd);
645
- that.read();
646
- }
647
- });
648
- }
649
- function WriteStream(path, options) {
650
- if (this instanceof WriteStream) return fs$WriteStream.apply(this, arguments), this;
651
- else return WriteStream.apply(Object.create(WriteStream.prototype), arguments);
652
- }
653
- function WriteStream$open() {
654
- var that = this;
655
- open(that.path, that.flags, that.mode, function(err, fd) {
656
- if (err) {
657
- that.destroy();
658
- that.emit("error", err);
659
- } else {
660
- that.fd = fd;
661
- that.emit("open", fd);
662
- }
663
- });
664
- }
665
- function createReadStream(path, options) {
666
- return new fs.ReadStream(path, options);
667
- }
668
- function createWriteStream(path, options) {
669
- return new fs.WriteStream(path, options);
670
- }
671
- var fs$open = fs.open;
672
- fs.open = open;
673
- function open(path, flags, mode, cb) {
674
- if (typeof mode === "function") cb = mode, mode = null;
675
- return go$open(path, flags, mode, cb);
676
- function go$open(path, flags, mode, cb, startTime) {
677
- return fs$open(path, flags, mode, function(err, fd) {
678
- if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([
679
- go$open,
680
- [
681
- path,
682
- flags,
683
- mode,
684
- cb
685
- ],
686
- err,
687
- startTime || Date.now(),
688
- Date.now()
689
- ]);
690
- else if (typeof cb === "function") cb.apply(this, arguments);
691
- });
692
- }
693
- }
694
- return fs;
695
- }
696
- function enqueue(elem) {
697
- debug("ENQUEUE", elem[0].name, elem[1]);
698
- fs[gracefulQueue].push(elem);
699
- retry();
700
- }
701
- var retryTimer;
702
- function resetQueue() {
703
- var now = Date.now();
704
- for (var i = 0; i < fs[gracefulQueue].length; ++i) if (fs[gracefulQueue][i].length > 2) {
705
- fs[gracefulQueue][i][3] = now;
706
- fs[gracefulQueue][i][4] = now;
707
- }
708
- retry();
709
- }
710
- function retry() {
711
- clearTimeout(retryTimer);
712
- retryTimer = void 0;
713
- if (fs[gracefulQueue].length === 0) return;
714
- var elem = fs[gracefulQueue].shift();
715
- var fn = elem[0];
716
- var args = elem[1];
717
- var err = elem[2];
718
- var startTime = elem[3];
719
- var lastTime = elem[4];
720
- if (startTime === void 0) {
721
- debug("RETRY", fn.name, args);
722
- fn.apply(null, args);
723
- } else if (Date.now() - startTime >= 6e4) {
724
- debug("TIMEOUT", fn.name, args);
725
- var cb = args.pop();
726
- if (typeof cb === "function") cb.call(null, err);
727
- } else {
728
- var sinceAttempt = Date.now() - lastTime;
729
- var sinceStart = Math.max(lastTime - startTime, 1);
730
- if (sinceAttempt >= Math.min(sinceStart * 1.2, 100)) {
731
- debug("RETRY", fn.name, args);
732
- fn.apply(null, args.concat([startTime]));
733
- } else fs[gracefulQueue].push(elem);
734
- }
735
- if (retryTimer === void 0) retryTimer = setTimeout(retry, 0);
736
- }
737
- }));
738
- //#endregion
739
- //#region ../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/fs/index.js
740
- var require_fs = /* @__PURE__ */ __commonJSMin(((exports) => {
741
- const u = require_universalify().fromCallback;
742
- const fs = require_graceful_fs();
743
- const api = [
744
- "access",
745
- "appendFile",
746
- "chmod",
747
- "chown",
748
- "close",
749
- "copyFile",
750
- "cp",
751
- "fchmod",
752
- "fchown",
753
- "fdatasync",
754
- "fstat",
755
- "fsync",
756
- "ftruncate",
757
- "futimes",
758
- "glob",
759
- "lchmod",
760
- "lchown",
761
- "lutimes",
762
- "link",
763
- "lstat",
764
- "mkdir",
765
- "mkdtemp",
766
- "open",
767
- "opendir",
768
- "readdir",
769
- "readFile",
770
- "readlink",
771
- "realpath",
772
- "rename",
773
- "rm",
774
- "rmdir",
775
- "stat",
776
- "statfs",
777
- "symlink",
778
- "truncate",
779
- "unlink",
780
- "utimes",
781
- "writeFile"
782
- ].filter((key) => {
783
- return typeof fs[key] === "function";
784
- });
785
- Object.assign(exports, fs);
786
- api.forEach((method) => {
787
- exports[method] = u(fs[method]);
788
- });
789
- exports.exists = function(filename, callback) {
790
- if (typeof callback === "function") return fs.exists(filename, callback);
791
- return new Promise((resolve) => {
792
- return fs.exists(filename, resolve);
793
- });
794
- };
795
- exports.read = function(fd, buffer, offset, length, position, callback) {
796
- if (typeof callback === "function") return fs.read(fd, buffer, offset, length, position, callback);
797
- return new Promise((resolve, reject) => {
798
- fs.read(fd, buffer, offset, length, position, (err, bytesRead, buffer) => {
799
- if (err) return reject(err);
800
- resolve({
801
- bytesRead,
802
- buffer
803
- });
804
- });
805
- });
806
- };
807
- exports.write = function(fd, buffer, ...args) {
808
- if (typeof args[args.length - 1] === "function") return fs.write(fd, buffer, ...args);
809
- return new Promise((resolve, reject) => {
810
- fs.write(fd, buffer, ...args, (err, bytesWritten, buffer) => {
811
- if (err) return reject(err);
812
- resolve({
813
- bytesWritten,
814
- buffer
815
- });
816
- });
817
- });
818
- };
819
- exports.readv = function(fd, buffers, ...args) {
820
- if (typeof args[args.length - 1] === "function") return fs.readv(fd, buffers, ...args);
821
- return new Promise((resolve, reject) => {
822
- fs.readv(fd, buffers, ...args, (err, bytesRead, buffers) => {
823
- if (err) return reject(err);
824
- resolve({
825
- bytesRead,
826
- buffers
827
- });
828
- });
829
- });
830
- };
831
- exports.writev = function(fd, buffers, ...args) {
832
- if (typeof args[args.length - 1] === "function") return fs.writev(fd, buffers, ...args);
833
- return new Promise((resolve, reject) => {
834
- fs.writev(fd, buffers, ...args, (err, bytesWritten, buffers) => {
835
- if (err) return reject(err);
836
- resolve({
837
- bytesWritten,
838
- buffers
839
- });
840
- });
841
- });
842
- };
843
- if (typeof fs.realpath.native === "function") exports.realpath.native = u(fs.realpath.native);
844
- else process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?", "Warning", "fs-extra-WARN0003");
845
- }));
846
- //#endregion
847
- //#region ../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/mkdirs/utils.js
848
- var require_utils$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
849
- const path$11 = __require("path");
850
- module.exports.checkPath = function checkPath(pth) {
851
- if (process.platform === "win32") {
852
- if (/[<>:"|?*]/.test(pth.replace(path$11.parse(pth).root, ""))) {
853
- const error = /* @__PURE__ */ new Error(`Path contains invalid characters: ${pth}`);
854
- error.code = "EINVAL";
855
- throw error;
856
- }
857
- }
858
- };
859
- }));
860
- //#endregion
861
- //#region ../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/mkdirs/make-dir.js
862
- var require_make_dir = /* @__PURE__ */ __commonJSMin(((exports, module) => {
863
- const fs = require_fs();
864
- const { checkPath } = require_utils$1();
865
- const getMode = (options) => {
866
- const defaults = { mode: 511 };
867
- if (typeof options === "number") return options;
868
- return {
869
- ...defaults,
870
- ...options
871
- }.mode;
872
- };
873
- module.exports.makeDir = async (dir, options) => {
874
- checkPath(dir);
875
- return fs.mkdir(dir, {
876
- mode: getMode(options),
877
- recursive: true
878
- });
879
- };
880
- module.exports.makeDirSync = (dir, options) => {
881
- checkPath(dir);
882
- return fs.mkdirSync(dir, {
883
- mode: getMode(options),
884
- recursive: true
885
- });
886
- };
887
- }));
888
- //#endregion
889
- //#region ../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/mkdirs/index.js
890
- var require_mkdirs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
891
- const u = require_universalify().fromPromise;
892
- const { makeDir: _makeDir, makeDirSync } = require_make_dir();
893
- const makeDir = u(_makeDir);
894
- module.exports = {
895
- mkdirs: makeDir,
896
- mkdirsSync: makeDirSync,
897
- mkdirp: makeDir,
898
- mkdirpSync: makeDirSync,
899
- ensureDir: makeDir,
900
- ensureDirSync: makeDirSync
901
- };
902
- }));
903
- //#endregion
904
- //#region ../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/path-exists/index.js
905
- var require_path_exists = /* @__PURE__ */ __commonJSMin(((exports, module) => {
906
- const u = require_universalify().fromPromise;
907
- const fs = require_fs();
908
- function pathExists(path) {
909
- return fs.access(path).then(() => true).catch(() => false);
910
- }
911
- module.exports = {
912
- pathExists: u(pathExists),
913
- pathExistsSync: fs.existsSync
914
- };
915
- }));
916
- //#endregion
917
- //#region ../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/util/utimes.js
918
- var require_utimes = /* @__PURE__ */ __commonJSMin(((exports, module) => {
919
- const fs = require_fs();
920
- const u = require_universalify().fromPromise;
921
- async function utimesMillis(path, atime, mtime) {
922
- const fd = await fs.open(path, "r+");
923
- let error = null;
924
- try {
925
- await fs.futimes(fd, atime, mtime);
926
- } catch (futimesErr) {
927
- error = futimesErr;
928
- } finally {
929
- try {
930
- await fs.close(fd);
931
- } catch (closeErr) {
932
- if (!error) error = closeErr;
933
- }
934
- }
935
- if (error) throw error;
936
- }
937
- function utimesMillisSync(path, atime, mtime) {
938
- const fd = fs.openSync(path, "r+");
939
- let error = null;
940
- try {
941
- fs.futimesSync(fd, atime, mtime);
942
- } catch (futimesErr) {
943
- error = futimesErr;
944
- } finally {
945
- try {
946
- fs.closeSync(fd);
947
- } catch (closeErr) {
948
- if (!error) error = closeErr;
949
- }
950
- }
951
- if (error) throw error;
952
- }
953
- module.exports = {
954
- utimesMillis: u(utimesMillis),
955
- utimesMillisSync
956
- };
957
- }));
958
- //#endregion
959
- //#region ../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/util/stat.js
960
- var require_stat = /* @__PURE__ */ __commonJSMin(((exports, module) => {
961
- const fs = require_fs();
962
- const path$10 = __require("path");
963
- const u = require_universalify().fromPromise;
964
- function getStats(src, dest, opts) {
965
- const statFunc = opts.dereference ? (file) => fs.stat(file, { bigint: true }) : (file) => fs.lstat(file, { bigint: true });
966
- return Promise.all([statFunc(src), statFunc(dest).catch((err) => {
967
- if (err.code === "ENOENT") return null;
968
- throw err;
969
- })]).then(([srcStat, destStat]) => ({
970
- srcStat,
971
- destStat
972
- }));
973
- }
974
- function getStatsSync(src, dest, opts) {
975
- let destStat;
976
- const statFunc = opts.dereference ? (file) => fs.statSync(file, { bigint: true }) : (file) => fs.lstatSync(file, { bigint: true });
977
- const srcStat = statFunc(src);
978
- try {
979
- destStat = statFunc(dest);
980
- } catch (err) {
981
- if (err.code === "ENOENT") return {
982
- srcStat,
983
- destStat: null
984
- };
985
- throw err;
986
- }
987
- return {
988
- srcStat,
989
- destStat
990
- };
991
- }
992
- async function checkPaths(src, dest, funcName, opts) {
993
- const { srcStat, destStat } = await getStats(src, dest, opts);
994
- if (destStat) {
995
- if (areIdentical(srcStat, destStat)) {
996
- const srcBaseName = path$10.basename(src);
997
- const destBaseName = path$10.basename(dest);
998
- if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) return {
999
- srcStat,
1000
- destStat,
1001
- isChangingCase: true
1002
- };
1003
- throw new Error("Source and destination must not be the same.");
1004
- }
1005
- if (srcStat.isDirectory() && !destStat.isDirectory()) throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`);
1006
- if (!srcStat.isDirectory() && destStat.isDirectory()) throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`);
1007
- }
1008
- if (srcStat.isDirectory() && isSrcSubdir(src, dest)) throw new Error(errMsg(src, dest, funcName));
1009
- return {
1010
- srcStat,
1011
- destStat
1012
- };
1013
- }
1014
- function checkPathsSync(src, dest, funcName, opts) {
1015
- const { srcStat, destStat } = getStatsSync(src, dest, opts);
1016
- if (destStat) {
1017
- if (areIdentical(srcStat, destStat)) {
1018
- const srcBaseName = path$10.basename(src);
1019
- const destBaseName = path$10.basename(dest);
1020
- if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) return {
1021
- srcStat,
1022
- destStat,
1023
- isChangingCase: true
1024
- };
1025
- throw new Error("Source and destination must not be the same.");
1026
- }
1027
- if (srcStat.isDirectory() && !destStat.isDirectory()) throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`);
1028
- if (!srcStat.isDirectory() && destStat.isDirectory()) throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`);
1029
- }
1030
- if (srcStat.isDirectory() && isSrcSubdir(src, dest)) throw new Error(errMsg(src, dest, funcName));
1031
- return {
1032
- srcStat,
1033
- destStat
1034
- };
1035
- }
1036
- async function checkParentPaths(src, srcStat, dest, funcName) {
1037
- const srcParent = path$10.resolve(path$10.dirname(src));
1038
- const destParent = path$10.resolve(path$10.dirname(dest));
1039
- if (destParent === srcParent || destParent === path$10.parse(destParent).root) return;
1040
- let destStat;
1041
- try {
1042
- destStat = await fs.stat(destParent, { bigint: true });
1043
- } catch (err) {
1044
- if (err.code === "ENOENT") return;
1045
- throw err;
1046
- }
1047
- if (areIdentical(srcStat, destStat)) throw new Error(errMsg(src, dest, funcName));
1048
- return checkParentPaths(src, srcStat, destParent, funcName);
1049
- }
1050
- function checkParentPathsSync(src, srcStat, dest, funcName) {
1051
- const srcParent = path$10.resolve(path$10.dirname(src));
1052
- const destParent = path$10.resolve(path$10.dirname(dest));
1053
- if (destParent === srcParent || destParent === path$10.parse(destParent).root) return;
1054
- let destStat;
1055
- try {
1056
- destStat = fs.statSync(destParent, { bigint: true });
1057
- } catch (err) {
1058
- if (err.code === "ENOENT") return;
1059
- throw err;
1060
- }
1061
- if (areIdentical(srcStat, destStat)) throw new Error(errMsg(src, dest, funcName));
1062
- return checkParentPathsSync(src, srcStat, destParent, funcName);
1063
- }
1064
- function areIdentical(srcStat, destStat) {
1065
- return destStat.ino !== void 0 && destStat.dev !== void 0 && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;
1066
- }
1067
- function isSrcSubdir(src, dest) {
1068
- const srcArr = path$10.resolve(src).split(path$10.sep).filter((i) => i);
1069
- const destArr = path$10.resolve(dest).split(path$10.sep).filter((i) => i);
1070
- return srcArr.every((cur, i) => destArr[i] === cur);
1071
- }
1072
- function errMsg(src, dest, funcName) {
1073
- return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`;
1074
- }
1075
- module.exports = {
1076
- checkPaths: u(checkPaths),
1077
- checkPathsSync,
1078
- checkParentPaths: u(checkParentPaths),
1079
- checkParentPathsSync,
1080
- isSrcSubdir,
1081
- areIdentical
1082
- };
1083
- }));
1084
- //#endregion
1085
- //#region ../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/util/async.js
1086
- var require_async = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1087
- async function asyncIteratorConcurrentProcess(iterator, fn) {
1088
- const promises = [];
1089
- for await (const item of iterator) promises.push(fn(item).then(() => null, (err) => err ?? /* @__PURE__ */ new Error("unknown error")));
1090
- await Promise.all(promises.map((promise) => promise.then((possibleErr) => {
1091
- if (possibleErr !== null) throw possibleErr;
1092
- })));
1093
- }
1094
- module.exports = { asyncIteratorConcurrentProcess };
1095
- }));
1096
- //#endregion
1097
- //#region ../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/copy/copy.js
1098
- var require_copy$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1099
- const fs = require_fs();
1100
- const path$9 = __require("path");
1101
- const { mkdirs } = require_mkdirs();
1102
- const { pathExists } = require_path_exists();
1103
- const { utimesMillis } = require_utimes();
1104
- const stat = require_stat();
1105
- const { asyncIteratorConcurrentProcess } = require_async();
1106
- async function copy(src, dest, opts = {}) {
1107
- if (typeof opts === "function") opts = { filter: opts };
1108
- opts.clobber = "clobber" in opts ? !!opts.clobber : true;
1109
- opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber;
1110
- if (opts.preserveTimestamps && process.arch === "ia32") process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269", "Warning", "fs-extra-WARN0001");
1111
- const { srcStat, destStat } = await stat.checkPaths(src, dest, "copy", opts);
1112
- await stat.checkParentPaths(src, srcStat, dest, "copy");
1113
- if (!await runFilter(src, dest, opts)) return;
1114
- const destParent = path$9.dirname(dest);
1115
- if (!await pathExists(destParent)) await mkdirs(destParent);
1116
- await getStatsAndPerformCopy(destStat, src, dest, opts);
1117
- }
1118
- async function runFilter(src, dest, opts) {
1119
- if (!opts.filter) return true;
1120
- return opts.filter(src, dest);
1121
- }
1122
- async function getStatsAndPerformCopy(destStat, src, dest, opts) {
1123
- const srcStat = await (opts.dereference ? fs.stat : fs.lstat)(src);
1124
- if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
1125
- if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
1126
- if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts);
1127
- if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`);
1128
- if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`);
1129
- throw new Error(`Unknown file: ${src}`);
1130
- }
1131
- async function onFile(srcStat, destStat, src, dest, opts) {
1132
- if (!destStat) return copyFile(srcStat, src, dest, opts);
1133
- if (opts.overwrite) {
1134
- await fs.unlink(dest);
1135
- return copyFile(srcStat, src, dest, opts);
1136
- }
1137
- if (opts.errorOnExist) throw new Error(`'${dest}' already exists`);
1138
- }
1139
- async function copyFile(srcStat, src, dest, opts) {
1140
- await fs.copyFile(src, dest);
1141
- if (opts.preserveTimestamps) {
1142
- if (fileIsNotWritable(srcStat.mode)) await makeFileWritable(dest, srcStat.mode);
1143
- const updatedSrcStat = await fs.stat(src);
1144
- await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
1145
- }
1146
- return fs.chmod(dest, srcStat.mode);
1147
- }
1148
- function fileIsNotWritable(srcMode) {
1149
- return (srcMode & 128) === 0;
1150
- }
1151
- function makeFileWritable(dest, srcMode) {
1152
- return fs.chmod(dest, srcMode | 128);
1153
- }
1154
- async function onDir(srcStat, destStat, src, dest, opts) {
1155
- if (!destStat) await fs.mkdir(dest);
1156
- await asyncIteratorConcurrentProcess(await fs.opendir(src), async (item) => {
1157
- const srcItem = path$9.join(src, item.name);
1158
- const destItem = path$9.join(dest, item.name);
1159
- if (await runFilter(srcItem, destItem, opts)) {
1160
- const { destStat } = await stat.checkPaths(srcItem, destItem, "copy", opts);
1161
- await getStatsAndPerformCopy(destStat, srcItem, destItem, opts);
1162
- }
1163
- });
1164
- if (!destStat) await fs.chmod(dest, srcStat.mode);
1165
- }
1166
- async function onLink(destStat, src, dest, opts) {
1167
- let resolvedSrc = await fs.readlink(src);
1168
- if (opts.dereference) resolvedSrc = path$9.resolve(process.cwd(), resolvedSrc);
1169
- if (!destStat) return fs.symlink(resolvedSrc, dest);
1170
- let resolvedDest = null;
1171
- try {
1172
- resolvedDest = await fs.readlink(dest);
1173
- } catch (e) {
1174
- if (e.code === "EINVAL" || e.code === "UNKNOWN") return fs.symlink(resolvedSrc, dest);
1175
- throw e;
1176
- }
1177
- if (opts.dereference) resolvedDest = path$9.resolve(process.cwd(), resolvedDest);
1178
- if (resolvedSrc !== resolvedDest) {
1179
- if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
1180
- if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
1181
- }
1182
- await fs.unlink(dest);
1183
- return fs.symlink(resolvedSrc, dest);
1184
- }
1185
- module.exports = copy;
1186
- }));
1187
- //#endregion
1188
- //#region ../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/copy/copy-sync.js
1189
- var require_copy_sync = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1190
- const fs = require_graceful_fs();
1191
- const path$8 = __require("path");
1192
- const mkdirsSync = require_mkdirs().mkdirsSync;
1193
- const utimesMillisSync = require_utimes().utimesMillisSync;
1194
- const stat = require_stat();
1195
- function copySync(src, dest, opts) {
1196
- if (typeof opts === "function") opts = { filter: opts };
1197
- opts = opts || {};
1198
- opts.clobber = "clobber" in opts ? !!opts.clobber : true;
1199
- opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber;
1200
- if (opts.preserveTimestamps && process.arch === "ia32") process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269", "Warning", "fs-extra-WARN0002");
1201
- const { srcStat, destStat } = stat.checkPathsSync(src, dest, "copy", opts);
1202
- stat.checkParentPathsSync(src, srcStat, dest, "copy");
1203
- if (opts.filter && !opts.filter(src, dest)) return;
1204
- const destParent = path$8.dirname(dest);
1205
- if (!fs.existsSync(destParent)) mkdirsSync(destParent);
1206
- return getStats(destStat, src, dest, opts);
1207
- }
1208
- function getStats(destStat, src, dest, opts) {
1209
- const srcStat = (opts.dereference ? fs.statSync : fs.lstatSync)(src);
1210
- if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
1211
- else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
1212
- else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts);
1213
- else if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`);
1214
- else if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`);
1215
- throw new Error(`Unknown file: ${src}`);
1216
- }
1217
- function onFile(srcStat, destStat, src, dest, opts) {
1218
- if (!destStat) return copyFile(srcStat, src, dest, opts);
1219
- return mayCopyFile(srcStat, src, dest, opts);
1220
- }
1221
- function mayCopyFile(srcStat, src, dest, opts) {
1222
- if (opts.overwrite) {
1223
- fs.unlinkSync(dest);
1224
- return copyFile(srcStat, src, dest, opts);
1225
- } else if (opts.errorOnExist) throw new Error(`'${dest}' already exists`);
1226
- }
1227
- function copyFile(srcStat, src, dest, opts) {
1228
- fs.copyFileSync(src, dest);
1229
- if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest);
1230
- return setDestMode(dest, srcStat.mode);
1231
- }
1232
- function handleTimestamps(srcMode, src, dest) {
1233
- if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode);
1234
- return setDestTimestamps(src, dest);
1235
- }
1236
- function fileIsNotWritable(srcMode) {
1237
- return (srcMode & 128) === 0;
1238
- }
1239
- function makeFileWritable(dest, srcMode) {
1240
- return setDestMode(dest, srcMode | 128);
1241
- }
1242
- function setDestMode(dest, srcMode) {
1243
- return fs.chmodSync(dest, srcMode);
1244
- }
1245
- function setDestTimestamps(src, dest) {
1246
- const updatedSrcStat = fs.statSync(src);
1247
- return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
1248
- }
1249
- function onDir(srcStat, destStat, src, dest, opts) {
1250
- if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts);
1251
- return copyDir(src, dest, opts);
1252
- }
1253
- function mkDirAndCopy(srcMode, src, dest, opts) {
1254
- fs.mkdirSync(dest);
1255
- copyDir(src, dest, opts);
1256
- return setDestMode(dest, srcMode);
1257
- }
1258
- function copyDir(src, dest, opts) {
1259
- const dir = fs.opendirSync(src);
1260
- try {
1261
- let dirent;
1262
- while ((dirent = dir.readSync()) !== null) copyDirItem(dirent.name, src, dest, opts);
1263
- } finally {
1264
- dir.closeSync();
1265
- }
1266
- }
1267
- function copyDirItem(item, src, dest, opts) {
1268
- const srcItem = path$8.join(src, item);
1269
- const destItem = path$8.join(dest, item);
1270
- if (opts.filter && !opts.filter(srcItem, destItem)) return;
1271
- const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy", opts);
1272
- return getStats(destStat, srcItem, destItem, opts);
1273
- }
1274
- function onLink(destStat, src, dest, opts) {
1275
- let resolvedSrc = fs.readlinkSync(src);
1276
- if (opts.dereference) resolvedSrc = path$8.resolve(process.cwd(), resolvedSrc);
1277
- if (!destStat) return fs.symlinkSync(resolvedSrc, dest);
1278
- else {
1279
- let resolvedDest;
1280
- try {
1281
- resolvedDest = fs.readlinkSync(dest);
1282
- } catch (err) {
1283
- if (err.code === "EINVAL" || err.code === "UNKNOWN") return fs.symlinkSync(resolvedSrc, dest);
1284
- throw err;
1285
- }
1286
- if (opts.dereference) resolvedDest = path$8.resolve(process.cwd(), resolvedDest);
1287
- if (resolvedSrc !== resolvedDest) {
1288
- if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
1289
- if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
1290
- }
1291
- return copyLink(resolvedSrc, dest);
1292
- }
1293
- }
1294
- function copyLink(resolvedSrc, dest) {
1295
- fs.unlinkSync(dest);
1296
- return fs.symlinkSync(resolvedSrc, dest);
1297
- }
1298
- module.exports = copySync;
1299
- }));
1300
- //#endregion
1301
- //#region ../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/copy/index.js
1302
- var require_copy = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1303
- const u = require_universalify().fromPromise;
1304
- module.exports = {
1305
- copy: u(require_copy$1()),
1306
- copySync: require_copy_sync()
1307
- };
1308
- }));
1309
- //#endregion
1310
- //#region ../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/remove/index.js
1311
- var require_remove = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1312
- const fs = require_graceful_fs();
1313
- const u = require_universalify().fromCallback;
1314
- function remove(path, callback) {
1315
- fs.rm(path, {
1316
- recursive: true,
1317
- force: true
1318
- }, callback);
1319
- }
1320
- function removeSync(path) {
1321
- fs.rmSync(path, {
1322
- recursive: true,
1323
- force: true
1324
- });
1325
- }
1326
- module.exports = {
1327
- remove: u(remove),
1328
- removeSync
1329
- };
1330
- }));
1331
- //#endregion
1332
- //#region ../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/empty/index.js
1333
- var require_empty = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1334
- const u = require_universalify().fromPromise;
1335
- const fs = require_fs();
1336
- const path$7 = __require("path");
1337
- const mkdir = require_mkdirs();
1338
- const remove = require_remove();
1339
- const emptyDir = u(async function emptyDir(dir) {
1340
- let items;
1341
- try {
1342
- items = await fs.readdir(dir);
1343
- } catch {
1344
- return mkdir.mkdirs(dir);
1345
- }
1346
- return Promise.all(items.map((item) => remove.remove(path$7.join(dir, item))));
1347
- });
1348
- function emptyDirSync(dir) {
1349
- let items;
1350
- try {
1351
- items = fs.readdirSync(dir);
1352
- } catch {
1353
- return mkdir.mkdirsSync(dir);
1354
- }
1355
- items.forEach((item) => {
1356
- item = path$7.join(dir, item);
1357
- remove.removeSync(item);
1358
- });
1359
- }
1360
- module.exports = {
1361
- emptyDirSync,
1362
- emptydirSync: emptyDirSync,
1363
- emptyDir,
1364
- emptydir: emptyDir
1365
- };
1366
- }));
1367
- //#endregion
1368
- //#region ../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/ensure/file.js
1369
- var require_file = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1370
- const u = require_universalify().fromPromise;
1371
- const path$6 = __require("path");
1372
- const fs = require_fs();
1373
- const mkdir = require_mkdirs();
1374
- async function createFile(file) {
1375
- let stats;
1376
- try {
1377
- stats = await fs.stat(file);
1378
- } catch {}
1379
- if (stats && stats.isFile()) return;
1380
- const dir = path$6.dirname(file);
1381
- let dirStats = null;
1382
- try {
1383
- dirStats = await fs.stat(dir);
1384
- } catch (err) {
1385
- if (err.code === "ENOENT") {
1386
- await mkdir.mkdirs(dir);
1387
- await fs.writeFile(file, "");
1388
- return;
1389
- } else throw err;
1390
- }
1391
- if (dirStats.isDirectory()) await fs.writeFile(file, "");
1392
- else await fs.readdir(dir);
1393
- }
1394
- function createFileSync(file) {
1395
- let stats;
1396
- try {
1397
- stats = fs.statSync(file);
1398
- } catch {}
1399
- if (stats && stats.isFile()) return;
1400
- const dir = path$6.dirname(file);
1401
- try {
1402
- if (!fs.statSync(dir).isDirectory()) fs.readdirSync(dir);
1403
- } catch (err) {
1404
- if (err && err.code === "ENOENT") mkdir.mkdirsSync(dir);
1405
- else throw err;
1406
- }
1407
- fs.writeFileSync(file, "");
1408
- }
1409
- module.exports = {
1410
- createFile: u(createFile),
1411
- createFileSync
1412
- };
1413
- }));
1414
- //#endregion
1415
- //#region ../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/ensure/link.js
1416
- var require_link = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1417
- const u = require_universalify().fromPromise;
1418
- const path$5 = __require("path");
1419
- const fs = require_fs();
1420
- const mkdir = require_mkdirs();
1421
- const { pathExists } = require_path_exists();
1422
- const { areIdentical } = require_stat();
1423
- async function createLink(srcpath, dstpath) {
1424
- let dstStat;
1425
- try {
1426
- dstStat = await fs.lstat(dstpath, { bigint: true });
1427
- } catch {}
1428
- let srcStat;
1429
- try {
1430
- srcStat = await fs.lstat(srcpath, { bigint: true });
1431
- } catch (err) {
1432
- err.message = err.message.replace("lstat", "ensureLink");
1433
- throw err;
1434
- }
1435
- if (dstStat && areIdentical(srcStat, dstStat)) return;
1436
- const dir = path$5.dirname(dstpath);
1437
- if (!await pathExists(dir)) await mkdir.mkdirs(dir);
1438
- await fs.link(srcpath, dstpath);
1439
- }
1440
- function createLinkSync(srcpath, dstpath) {
1441
- let dstStat;
1442
- try {
1443
- dstStat = fs.lstatSync(dstpath, { bigint: true });
1444
- } catch {}
1445
- try {
1446
- const srcStat = fs.lstatSync(srcpath, { bigint: true });
1447
- if (dstStat && areIdentical(srcStat, dstStat)) return;
1448
- } catch (err) {
1449
- err.message = err.message.replace("lstat", "ensureLink");
1450
- throw err;
1451
- }
1452
- const dir = path$5.dirname(dstpath);
1453
- if (fs.existsSync(dir)) return fs.linkSync(srcpath, dstpath);
1454
- mkdir.mkdirsSync(dir);
1455
- return fs.linkSync(srcpath, dstpath);
1456
- }
1457
- module.exports = {
1458
- createLink: u(createLink),
1459
- createLinkSync
1460
- };
1461
- }));
1462
- //#endregion
1463
- //#region ../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/ensure/symlink-paths.js
1464
- var require_symlink_paths = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1465
- const path$4 = __require("path");
1466
- const fs = require_fs();
1467
- const { pathExists } = require_path_exists();
1468
- const u = require_universalify().fromPromise;
1469
- /**
1470
- * Function that returns two types of paths, one relative to symlink, and one
1471
- * relative to the current working directory. Checks if path is absolute or
1472
- * relative. If the path is relative, this function checks if the path is
1473
- * relative to symlink or relative to current working directory. This is an
1474
- * initiative to find a smarter `srcpath` to supply when building symlinks.
1475
- * This allows you to determine which path to use out of one of three possible
1476
- * types of source paths. The first is an absolute path. This is detected by
1477
- * `path.isAbsolute()`. When an absolute path is provided, it is checked to
1478
- * see if it exists. If it does it's used, if not an error is returned
1479
- * (callback)/ thrown (sync). The other two options for `srcpath` are a
1480
- * relative url. By default Node's `fs.symlink` works by creating a symlink
1481
- * using `dstpath` and expects the `srcpath` to be relative to the newly
1482
- * created symlink. If you provide a `srcpath` that does not exist on the file
1483
- * system it results in a broken symlink. To minimize this, the function
1484
- * checks to see if the 'relative to symlink' source file exists, and if it
1485
- * does it will use it. If it does not, it checks if there's a file that
1486
- * exists that is relative to the current working directory, if does its used.
1487
- * This preserves the expectations of the original fs.symlink spec and adds
1488
- * the ability to pass in `relative to current working direcotry` paths.
1489
- */
1490
- async function symlinkPaths(srcpath, dstpath) {
1491
- if (path$4.isAbsolute(srcpath)) {
1492
- try {
1493
- await fs.lstat(srcpath);
1494
- } catch (err) {
1495
- err.message = err.message.replace("lstat", "ensureSymlink");
1496
- throw err;
1497
- }
1498
- return {
1499
- toCwd: srcpath,
1500
- toDst: srcpath
1501
- };
1502
- }
1503
- const dstdir = path$4.dirname(dstpath);
1504
- const relativeToDst = path$4.join(dstdir, srcpath);
1505
- if (await pathExists(relativeToDst)) return {
1506
- toCwd: relativeToDst,
1507
- toDst: srcpath
1508
- };
1509
- try {
1510
- await fs.lstat(srcpath);
1511
- } catch (err) {
1512
- err.message = err.message.replace("lstat", "ensureSymlink");
1513
- throw err;
1514
- }
1515
- return {
1516
- toCwd: srcpath,
1517
- toDst: path$4.relative(dstdir, srcpath)
1518
- };
1519
- }
1520
- function symlinkPathsSync(srcpath, dstpath) {
1521
- if (path$4.isAbsolute(srcpath)) {
1522
- if (!fs.existsSync(srcpath)) throw new Error("absolute srcpath does not exist");
1523
- return {
1524
- toCwd: srcpath,
1525
- toDst: srcpath
1526
- };
1527
- }
1528
- const dstdir = path$4.dirname(dstpath);
1529
- const relativeToDst = path$4.join(dstdir, srcpath);
1530
- if (fs.existsSync(relativeToDst)) return {
1531
- toCwd: relativeToDst,
1532
- toDst: srcpath
1533
- };
1534
- if (!fs.existsSync(srcpath)) throw new Error("relative srcpath does not exist");
1535
- return {
1536
- toCwd: srcpath,
1537
- toDst: path$4.relative(dstdir, srcpath)
1538
- };
1539
- }
1540
- module.exports = {
1541
- symlinkPaths: u(symlinkPaths),
1542
- symlinkPathsSync
1543
- };
1544
- }));
1545
- //#endregion
1546
- //#region ../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/ensure/symlink-type.js
1547
- var require_symlink_type = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1548
- const fs = require_fs();
1549
- const u = require_universalify().fromPromise;
1550
- async function symlinkType(srcpath, type) {
1551
- if (type) return type;
1552
- let stats;
1553
- try {
1554
- stats = await fs.lstat(srcpath);
1555
- } catch {
1556
- return "file";
1557
- }
1558
- return stats && stats.isDirectory() ? "dir" : "file";
1559
- }
1560
- function symlinkTypeSync(srcpath, type) {
1561
- if (type) return type;
1562
- let stats;
1563
- try {
1564
- stats = fs.lstatSync(srcpath);
1565
- } catch {
1566
- return "file";
1567
- }
1568
- return stats && stats.isDirectory() ? "dir" : "file";
1569
- }
1570
- module.exports = {
1571
- symlinkType: u(symlinkType),
1572
- symlinkTypeSync
1573
- };
1574
- }));
1575
- //#endregion
1576
- //#region ../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/ensure/symlink.js
1577
- var require_symlink = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1578
- const u = require_universalify().fromPromise;
1579
- const path$3 = __require("path");
1580
- const fs = require_fs();
1581
- const { mkdirs, mkdirsSync } = require_mkdirs();
1582
- const { symlinkPaths, symlinkPathsSync } = require_symlink_paths();
1583
- const { symlinkType, symlinkTypeSync } = require_symlink_type();
1584
- const { pathExists } = require_path_exists();
1585
- const { areIdentical } = require_stat();
1586
- async function createSymlink(srcpath, dstpath, type) {
1587
- let stats;
1588
- try {
1589
- stats = await fs.lstat(dstpath);
1590
- } catch {}
1591
- if (stats && stats.isSymbolicLink()) {
1592
- let srcStat;
1593
- if (path$3.isAbsolute(srcpath)) srcStat = await fs.stat(srcpath, { bigint: true });
1594
- else {
1595
- const dstdir = path$3.dirname(dstpath);
1596
- const relativeToDst = path$3.join(dstdir, srcpath);
1597
- try {
1598
- srcStat = await fs.stat(relativeToDst, { bigint: true });
1599
- } catch {
1600
- srcStat = await fs.stat(srcpath, { bigint: true });
1601
- }
1602
- }
1603
- const dstStat = await fs.stat(dstpath, { bigint: true });
1604
- if (areIdentical(srcStat, dstStat)) return;
1605
- }
1606
- const relative = await symlinkPaths(srcpath, dstpath);
1607
- srcpath = relative.toDst;
1608
- const toType = await symlinkType(relative.toCwd, type);
1609
- const dir = path$3.dirname(dstpath);
1610
- if (!await pathExists(dir)) await mkdirs(dir);
1611
- return fs.symlink(srcpath, dstpath, toType);
1612
- }
1613
- function createSymlinkSync(srcpath, dstpath, type) {
1614
- let stats;
1615
- try {
1616
- stats = fs.lstatSync(dstpath);
1617
- } catch {}
1618
- if (stats && stats.isSymbolicLink()) {
1619
- let srcStat;
1620
- if (path$3.isAbsolute(srcpath)) srcStat = fs.statSync(srcpath, { bigint: true });
1621
- else {
1622
- const dstdir = path$3.dirname(dstpath);
1623
- const relativeToDst = path$3.join(dstdir, srcpath);
1624
- try {
1625
- srcStat = fs.statSync(relativeToDst, { bigint: true });
1626
- } catch {
1627
- srcStat = fs.statSync(srcpath, { bigint: true });
1628
- }
1629
- }
1630
- const dstStat = fs.statSync(dstpath, { bigint: true });
1631
- if (areIdentical(srcStat, dstStat)) return;
1632
- }
1633
- const relative = symlinkPathsSync(srcpath, dstpath);
1634
- srcpath = relative.toDst;
1635
- type = symlinkTypeSync(relative.toCwd, type);
1636
- const dir = path$3.dirname(dstpath);
1637
- if (fs.existsSync(dir)) return fs.symlinkSync(srcpath, dstpath, type);
1638
- mkdirsSync(dir);
1639
- return fs.symlinkSync(srcpath, dstpath, type);
1640
- }
1641
- module.exports = {
1642
- createSymlink: u(createSymlink),
1643
- createSymlinkSync
1644
- };
1645
- }));
1646
- //#endregion
1647
- //#region ../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/ensure/index.js
1648
- var require_ensure = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1649
- const { createFile, createFileSync } = require_file();
1650
- const { createLink, createLinkSync } = require_link();
1651
- const { createSymlink, createSymlinkSync } = require_symlink();
1652
- module.exports = {
1653
- createFile,
1654
- createFileSync,
1655
- ensureFile: createFile,
1656
- ensureFileSync: createFileSync,
1657
- createLink,
1658
- createLinkSync,
1659
- ensureLink: createLink,
1660
- ensureLinkSync: createLinkSync,
1661
- createSymlink,
1662
- createSymlinkSync,
1663
- ensureSymlink: createSymlink,
1664
- ensureSymlinkSync: createSymlinkSync
1665
- };
1666
- }));
1667
- //#endregion
1668
- //#region ../../node_modules/.pnpm/jsonfile@6.2.1/node_modules/jsonfile/utils.js
1669
- var require_utils = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1670
- function stringify(obj, { EOL = "\n", finalEOL = true, replacer = null, spaces } = {}) {
1671
- const EOF = finalEOL ? EOL : "";
1672
- const str = JSON.stringify(obj, replacer, spaces);
1673
- if (str === void 0) throw new TypeError(`Converting ${typeof obj} value to JSON is not supported`);
1674
- return str.replace(/\n/g, EOL) + EOF;
1675
- }
1676
- function stripBom(content) {
1677
- if (Buffer.isBuffer(content)) content = content.toString("utf8");
1678
- return content.replace(/^\uFEFF/, "");
1679
- }
1680
- module.exports = {
1681
- stringify,
1682
- stripBom
1683
- };
1684
- }));
1685
- //#endregion
1686
- //#region ../../node_modules/.pnpm/jsonfile@6.2.1/node_modules/jsonfile/index.js
1687
- var require_jsonfile$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1688
- let _fs;
1689
- try {
1690
- _fs = require_graceful_fs();
1691
- } catch (_) {
1692
- _fs = __require("fs");
1693
- }
1694
- const universalify = require_universalify();
1695
- const { stringify, stripBom } = require_utils();
1696
- async function _readFile(file, options = {}) {
1697
- if (typeof options === "string") options = { encoding: options };
1698
- const fs = options.fs || _fs;
1699
- const shouldThrow = "throws" in options ? options.throws : true;
1700
- let data = await universalify.fromCallback(fs.readFile)(file, options);
1701
- data = stripBom(data);
1702
- let obj;
1703
- try {
1704
- obj = JSON.parse(data, options ? options.reviver : null);
1705
- } catch (err) {
1706
- if (shouldThrow) {
1707
- err.message = `${file}: ${err.message}`;
1708
- throw err;
1709
- } else return null;
1710
- }
1711
- return obj;
1712
- }
1713
- const readFile = universalify.fromPromise(_readFile);
1714
- function readFileSync(file, options = {}) {
1715
- if (typeof options === "string") options = { encoding: options };
1716
- const fs = options.fs || _fs;
1717
- const shouldThrow = "throws" in options ? options.throws : true;
1718
- try {
1719
- let content = fs.readFileSync(file, options);
1720
- content = stripBom(content);
1721
- return JSON.parse(content, options.reviver);
1722
- } catch (err) {
1723
- if (shouldThrow) {
1724
- err.message = `${file}: ${err.message}`;
1725
- throw err;
1726
- } else return null;
1727
- }
1728
- }
1729
- async function _writeFile(file, obj, options = {}) {
1730
- const fs = options.fs || _fs;
1731
- const str = stringify(obj, options);
1732
- await universalify.fromCallback(fs.writeFile)(file, str, options);
1733
- }
1734
- const writeFile = universalify.fromPromise(_writeFile);
1735
- function writeFileSync(file, obj, options = {}) {
1736
- const fs = options.fs || _fs;
1737
- const str = stringify(obj, options);
1738
- return fs.writeFileSync(file, str, options);
1739
- }
1740
- module.exports = {
1741
- readFile,
1742
- readFileSync,
1743
- writeFile,
1744
- writeFileSync
1745
- };
1746
- }));
1747
- //#endregion
1748
- //#region ../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/json/jsonfile.js
1749
- var require_jsonfile = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1750
- const jsonFile = require_jsonfile$1();
1751
- module.exports = {
1752
- readJson: jsonFile.readFile,
1753
- readJsonSync: jsonFile.readFileSync,
1754
- writeJson: jsonFile.writeFile,
1755
- writeJsonSync: jsonFile.writeFileSync
1756
- };
1757
- }));
1758
- //#endregion
1759
- //#region ../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/output-file/index.js
1760
- var require_output_file = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1761
- const u = require_universalify().fromPromise;
1762
- const fs = require_fs();
1763
- const path$2 = __require("path");
1764
- const mkdir = require_mkdirs();
1765
- const pathExists = require_path_exists().pathExists;
1766
- async function outputFile(file, data, encoding = "utf-8") {
1767
- const dir = path$2.dirname(file);
1768
- if (!await pathExists(dir)) await mkdir.mkdirs(dir);
1769
- return fs.writeFile(file, data, encoding);
1770
- }
1771
- function outputFileSync(file, ...args) {
1772
- const dir = path$2.dirname(file);
1773
- if (!fs.existsSync(dir)) mkdir.mkdirsSync(dir);
1774
- fs.writeFileSync(file, ...args);
1775
- }
1776
- module.exports = {
1777
- outputFile: u(outputFile),
1778
- outputFileSync
1779
- };
1780
- }));
1781
- //#endregion
1782
- //#region ../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/json/output-json.js
1783
- var require_output_json = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1784
- const { stringify } = require_utils();
1785
- const { outputFile } = require_output_file();
1786
- async function outputJson(file, data, options = {}) {
1787
- await outputFile(file, stringify(data, options), options);
1788
- }
1789
- module.exports = outputJson;
1790
- }));
1791
- //#endregion
1792
- //#region ../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/json/output-json-sync.js
1793
- var require_output_json_sync = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1794
- const { stringify } = require_utils();
1795
- const { outputFileSync } = require_output_file();
1796
- function outputJsonSync(file, data, options) {
1797
- outputFileSync(file, stringify(data, options), options);
1798
- }
1799
- module.exports = outputJsonSync;
1800
- }));
1801
- //#endregion
1802
- //#region ../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/json/index.js
1803
- var require_json = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1804
- const u = require_universalify().fromPromise;
1805
- const jsonFile = require_jsonfile();
1806
- jsonFile.outputJson = u(require_output_json());
1807
- jsonFile.outputJsonSync = require_output_json_sync();
1808
- jsonFile.outputJSON = jsonFile.outputJson;
1809
- jsonFile.outputJSONSync = jsonFile.outputJsonSync;
1810
- jsonFile.writeJSON = jsonFile.writeJson;
1811
- jsonFile.writeJSONSync = jsonFile.writeJsonSync;
1812
- jsonFile.readJSON = jsonFile.readJson;
1813
- jsonFile.readJSONSync = jsonFile.readJsonSync;
1814
- module.exports = jsonFile;
1815
- }));
1816
- //#endregion
1817
- //#region ../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/move/move.js
1818
- var require_move$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1819
- const fs = require_fs();
1820
- const path$1 = __require("path");
1821
- const { copy } = require_copy();
1822
- const { remove } = require_remove();
1823
- const { mkdirp } = require_mkdirs();
1824
- const { pathExists } = require_path_exists();
1825
- const stat = require_stat();
1826
- async function move(src, dest, opts = {}) {
1827
- const overwrite = opts.overwrite || opts.clobber || false;
1828
- const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, "move", opts);
1829
- await stat.checkParentPaths(src, srcStat, dest, "move");
1830
- const destParent = path$1.dirname(dest);
1831
- if (path$1.parse(destParent).root !== destParent) await mkdirp(destParent);
1832
- return doRename(src, dest, overwrite, isChangingCase);
1833
- }
1834
- async function doRename(src, dest, overwrite, isChangingCase) {
1835
- if (!isChangingCase) {
1836
- if (overwrite) await remove(dest);
1837
- else if (await pathExists(dest)) throw new Error("dest already exists.");
1838
- }
1839
- try {
1840
- await fs.rename(src, dest);
1841
- } catch (err) {
1842
- if (err.code !== "EXDEV") throw err;
1843
- await moveAcrossDevice(src, dest, overwrite);
1844
- }
1845
- }
1846
- async function moveAcrossDevice(src, dest, overwrite) {
1847
- await copy(src, dest, {
1848
- overwrite,
1849
- errorOnExist: true,
1850
- preserveTimestamps: true
1851
- });
1852
- return remove(src);
1853
- }
1854
- module.exports = move;
1855
- }));
1856
- //#endregion
1857
- //#region ../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/move/move-sync.js
1858
- var require_move_sync = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1859
- const fs = require_graceful_fs();
1860
- const path = __require("path");
1861
- const copySync = require_copy().copySync;
1862
- const removeSync = require_remove().removeSync;
1863
- const mkdirpSync = require_mkdirs().mkdirpSync;
1864
- const stat = require_stat();
1865
- function moveSync(src, dest, opts) {
1866
- opts = opts || {};
1867
- const overwrite = opts.overwrite || opts.clobber || false;
1868
- const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, "move", opts);
1869
- stat.checkParentPathsSync(src, srcStat, dest, "move");
1870
- if (!isParentRoot(dest)) mkdirpSync(path.dirname(dest));
1871
- return doRename(src, dest, overwrite, isChangingCase);
1872
- }
1873
- function isParentRoot(dest) {
1874
- const parent = path.dirname(dest);
1875
- return path.parse(parent).root === parent;
1876
- }
1877
- function doRename(src, dest, overwrite, isChangingCase) {
1878
- if (isChangingCase) return rename(src, dest, overwrite);
1879
- if (overwrite) {
1880
- removeSync(dest);
1881
- return rename(src, dest, overwrite);
1882
- }
1883
- if (fs.existsSync(dest)) throw new Error("dest already exists.");
1884
- return rename(src, dest, overwrite);
1885
- }
1886
- function rename(src, dest, overwrite) {
1887
- try {
1888
- fs.renameSync(src, dest);
1889
- } catch (err) {
1890
- if (err.code !== "EXDEV") throw err;
1891
- return moveAcrossDevice(src, dest, overwrite);
1892
- }
1893
- }
1894
- function moveAcrossDevice(src, dest, overwrite) {
1895
- copySync(src, dest, {
1896
- overwrite,
1897
- errorOnExist: true,
1898
- preserveTimestamps: true
1899
- });
1900
- return removeSync(src);
1901
- }
1902
- module.exports = moveSync;
1903
- }));
1904
- //#endregion
1905
- //#region ../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/move/index.js
1906
- var require_move = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1907
- const u = require_universalify().fromPromise;
1908
- module.exports = {
1909
- move: u(require_move$1()),
1910
- moveSync: require_move_sync()
1911
- };
1912
- }));
1913
- //#endregion
1914
- //#region ../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/index.js
1915
- var require_lib = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1916
- module.exports = {
1917
- ...require_fs(),
1918
- ...require_copy(),
1919
- ...require_empty(),
1920
- ...require_ensure(),
1921
- ...require_json(),
1922
- ...require_mkdirs(),
1923
- ...require_move(),
1924
- ...require_output_file(),
1925
- ...require_path_exists(),
1926
- ...require_remove()
1927
- };
1928
- }));
1929
- //#endregion
1930
- export { require_lib as t };