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