| "use strict"; |
| var __create = Object.create; |
| var __defProp = Object.defineProperty; |
| var __getOwnPropDesc = Object.getOwnPropertyDescriptor; |
| var __getOwnPropNames = Object.getOwnPropertyNames; |
| var __getProtoOf = Object.getPrototypeOf; |
| var __hasOwnProp = Object.prototype.hasOwnProperty; |
| var __export = (target, all) => { |
| for (var name in all) |
| __defProp(target, name, { get: all[name], enumerable: true }); |
| }; |
| var __copyProps = (to, from, except, desc) => { |
| if (from && typeof from === "object" || typeof from === "function") { |
| for (let key of __getOwnPropNames(from)) |
| if (!__hasOwnProp.call(to, key) && key !== except) |
| __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); |
| } |
| return to; |
| }; |
| var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( |
| |
| |
| |
| |
| isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, |
| mod |
| )); |
| var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); |
| var chunk_LONQL55G_exports = {}; |
| __export(chunk_LONQL55G_exports, { |
| getCacheDir: () => getCacheDir, |
| getDownloadUrl: () => getDownloadUrl, |
| getRootCacheDir: () => getRootCacheDir, |
| overwriteFile: () => overwriteFile, |
| require_lib: () => require_lib |
| }); |
| module.exports = __toCommonJS(chunk_LONQL55G_exports); |
| var import_chunk_QGM4M3NI = require("./chunk-QGM4M3NI.js"); |
| var import_node_fs = __toESM(require("node:fs")); |
| var import_node_os = __toESM(require("node:os")); |
| var import_node_path = __toESM(require("node:path")); |
| var import_debug = __toESM(require("@prisma/debug")); |
| var import_get_platform = require("@prisma/get-platform"); |
| var import_node_process = __toESM(require("node:process")); |
| var import_node_path2 = __toESM(require("node:path")); |
| var import_node_fs2 = __toESM(require("node:fs")); |
| var import_node_path3 = __toESM(require("node:path")); |
| var import_node_path4 = __toESM(require("node:path")); |
| var import_node_url = require("node:url"); |
| var import_node_process2 = __toESM(require("node:process")); |
| var import_node_path5 = __toESM(require("node:path")); |
| var import_node_fs3 = __toESM(require("node:fs")); |
| var import_node_url2 = require("node:url"); |
| var require_common_path_prefix = (0, import_chunk_QGM4M3NI.__commonJS)({ |
| "../../node_modules/.pnpm/common-path-prefix@3.0.0/node_modules/common-path-prefix/index.js"(exports, module2) { |
| "use strict"; |
| var { sep: DEFAULT_SEPARATOR } = (0, import_chunk_QGM4M3NI.__require)("path"); |
| var determineSeparator = (paths) => { |
| for (const path6 of paths) { |
| const match = /(\/|\\)/.exec(path6); |
| if (match !== null) return match[0]; |
| } |
| return DEFAULT_SEPARATOR; |
| }; |
| module2.exports = function commonPathPrefix2(paths, sep = determineSeparator(paths)) { |
| const [first = "", ...remaining] = paths; |
| if (first === "" || remaining.length === 0) return ""; |
| const parts = first.split(sep); |
| let endOfPrefix = parts.length; |
| for (const path6 of remaining) { |
| const compare = path6.split(sep); |
| for (let i = 0; i < endOfPrefix; i++) { |
| if (compare[i] !== parts[i]) { |
| endOfPrefix = i; |
| } |
| } |
| if (endOfPrefix === 0) return ""; |
| } |
| const prefix = parts.slice(0, endOfPrefix).join(sep); |
| return prefix.endsWith(sep) ? prefix : prefix + sep; |
| }; |
| } |
| }); |
| var require_universalify = (0, import_chunk_QGM4M3NI.__commonJS)({ |
| "../../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js"(exports) { |
| "use strict"; |
| exports.fromCallback = function(fn) { |
| return Object.defineProperty(function(...args) { |
| if (typeof args[args.length - 1] === "function") fn.apply(this, args); |
| else { |
| return new Promise((resolve, reject) => { |
| args.push((err, res) => err != null ? reject(err) : resolve(res)); |
| fn.apply(this, args); |
| }); |
| } |
| }, "name", { value: fn.name }); |
| }; |
| exports.fromPromise = function(fn) { |
| return Object.defineProperty(function(...args) { |
| const cb = args[args.length - 1]; |
| if (typeof cb !== "function") return fn.apply(this, args); |
| else { |
| args.pop(); |
| fn.apply(this, args).then((r) => cb(null, r), cb); |
| } |
| }, "name", { value: fn.name }); |
| }; |
| } |
| }); |
| var require_polyfills = (0, import_chunk_QGM4M3NI.__commonJS)({ |
| "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js"(exports, module2) { |
| "use strict"; |
| var constants = (0, import_chunk_QGM4M3NI.__require)("constants"); |
| var origCwd = process.cwd; |
| var cwd2 = null; |
| var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform; |
| process.cwd = function() { |
| if (!cwd2) |
| cwd2 = origCwd.call(process); |
| return cwd2; |
| }; |
| try { |
| process.cwd(); |
| } catch (er) { |
| } |
| if (typeof process.chdir === "function") { |
| chdir = process.chdir; |
| process.chdir = function(d) { |
| cwd2 = null; |
| chdir.call(process, d); |
| }; |
| if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir); |
| } |
| var chdir; |
| module2.exports = patch; |
| function patch(fs4) { |
| if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { |
| patchLchmod(fs4); |
| } |
| if (!fs4.lutimes) { |
| patchLutimes(fs4); |
| } |
| fs4.chown = chownFix(fs4.chown); |
| fs4.fchown = chownFix(fs4.fchown); |
| fs4.lchown = chownFix(fs4.lchown); |
| fs4.chmod = chmodFix(fs4.chmod); |
| fs4.fchmod = chmodFix(fs4.fchmod); |
| fs4.lchmod = chmodFix(fs4.lchmod); |
| fs4.chownSync = chownFixSync(fs4.chownSync); |
| fs4.fchownSync = chownFixSync(fs4.fchownSync); |
| fs4.lchownSync = chownFixSync(fs4.lchownSync); |
| fs4.chmodSync = chmodFixSync(fs4.chmodSync); |
| fs4.fchmodSync = chmodFixSync(fs4.fchmodSync); |
| fs4.lchmodSync = chmodFixSync(fs4.lchmodSync); |
| fs4.stat = statFix(fs4.stat); |
| fs4.fstat = statFix(fs4.fstat); |
| fs4.lstat = statFix(fs4.lstat); |
| fs4.statSync = statFixSync(fs4.statSync); |
| fs4.fstatSync = statFixSync(fs4.fstatSync); |
| fs4.lstatSync = statFixSync(fs4.lstatSync); |
| if (fs4.chmod && !fs4.lchmod) { |
| fs4.lchmod = function(path6, mode, cb) { |
| if (cb) process.nextTick(cb); |
| }; |
| fs4.lchmodSync = function() { |
| }; |
| } |
| if (fs4.chown && !fs4.lchown) { |
| fs4.lchown = function(path6, uid, gid, cb) { |
| if (cb) process.nextTick(cb); |
| }; |
| fs4.lchownSync = function() { |
| }; |
| } |
| if (platform === "win32") { |
| fs4.rename = typeof fs4.rename !== "function" ? fs4.rename : function(fs$rename) { |
| function rename(from, to, cb) { |
| var start = Date.now(); |
| var backoff = 0; |
| fs$rename(from, to, function CB(er) { |
| if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) { |
| setTimeout(function() { |
| fs4.stat(to, function(stater, st) { |
| if (stater && stater.code === "ENOENT") |
| fs$rename(from, to, CB); |
| else |
| cb(er); |
| }); |
| }, backoff); |
| if (backoff < 100) |
| backoff += 10; |
| return; |
| } |
| if (cb) cb(er); |
| }); |
| } |
| if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename); |
| return rename; |
| }(fs4.rename); |
| } |
| fs4.read = typeof fs4.read !== "function" ? fs4.read : function(fs$read) { |
| function read(fd, buffer, offset, length, position, callback_) { |
| var callback; |
| if (callback_ && typeof callback_ === "function") { |
| var eagCounter = 0; |
| callback = function(er, _, __) { |
| if (er && er.code === "EAGAIN" && eagCounter < 10) { |
| eagCounter++; |
| return fs$read.call(fs4, fd, buffer, offset, length, position, callback); |
| } |
| callback_.apply(this, arguments); |
| }; |
| } |
| return fs$read.call(fs4, fd, buffer, offset, length, position, callback); |
| } |
| if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read); |
| return read; |
| }(fs4.read); |
| fs4.readSync = typeof fs4.readSync !== "function" ? fs4.readSync : function(fs$readSync) { |
| return function(fd, buffer, offset, length, position) { |
| var eagCounter = 0; |
| while (true) { |
| try { |
| return fs$readSync.call(fs4, fd, buffer, offset, length, position); |
| } catch (er) { |
| if (er.code === "EAGAIN" && eagCounter < 10) { |
| eagCounter++; |
| continue; |
| } |
| throw er; |
| } |
| } |
| }; |
| }(fs4.readSync); |
| function patchLchmod(fs5) { |
| fs5.lchmod = function(path6, mode, callback) { |
| fs5.open( |
| path6, |
| constants.O_WRONLY | constants.O_SYMLINK, |
| mode, |
| function(err, fd) { |
| if (err) { |
| if (callback) callback(err); |
| return; |
| } |
| fs5.fchmod(fd, mode, function(err2) { |
| fs5.close(fd, function(err22) { |
| if (callback) callback(err2 || err22); |
| }); |
| }); |
| } |
| ); |
| }; |
| fs5.lchmodSync = function(path6, mode) { |
| var fd = fs5.openSync(path6, constants.O_WRONLY | constants.O_SYMLINK, mode); |
| var threw = true; |
| var ret; |
| try { |
| ret = fs5.fchmodSync(fd, mode); |
| threw = false; |
| } finally { |
| if (threw) { |
| try { |
| fs5.closeSync(fd); |
| } catch (er) { |
| } |
| } else { |
| fs5.closeSync(fd); |
| } |
| } |
| return ret; |
| }; |
| } |
| function patchLutimes(fs5) { |
| if (constants.hasOwnProperty("O_SYMLINK") && fs5.futimes) { |
| fs5.lutimes = function(path6, at, mt, cb) { |
| fs5.open(path6, constants.O_SYMLINK, function(er, fd) { |
| if (er) { |
| if (cb) cb(er); |
| return; |
| } |
| fs5.futimes(fd, at, mt, function(er2) { |
| fs5.close(fd, function(er22) { |
| if (cb) cb(er2 || er22); |
| }); |
| }); |
| }); |
| }; |
| fs5.lutimesSync = function(path6, at, mt) { |
| var fd = fs5.openSync(path6, constants.O_SYMLINK); |
| var ret; |
| var threw = true; |
| try { |
| ret = fs5.futimesSync(fd, at, mt); |
| threw = false; |
| } finally { |
| if (threw) { |
| try { |
| fs5.closeSync(fd); |
| } catch (er) { |
| } |
| } else { |
| fs5.closeSync(fd); |
| } |
| } |
| return ret; |
| }; |
| } else if (fs5.futimes) { |
| fs5.lutimes = function(_a, _b, _c, cb) { |
| if (cb) process.nextTick(cb); |
| }; |
| fs5.lutimesSync = function() { |
| }; |
| } |
| } |
| function chmodFix(orig) { |
| if (!orig) return orig; |
| return function(target, mode, cb) { |
| return orig.call(fs4, target, mode, function(er) { |
| if (chownErOk(er)) er = null; |
| if (cb) cb.apply(this, arguments); |
| }); |
| }; |
| } |
| function chmodFixSync(orig) { |
| if (!orig) return orig; |
| return function(target, mode) { |
| try { |
| return orig.call(fs4, target, mode); |
| } catch (er) { |
| if (!chownErOk(er)) throw er; |
| } |
| }; |
| } |
| function chownFix(orig) { |
| if (!orig) return orig; |
| return function(target, uid, gid, cb) { |
| return orig.call(fs4, target, uid, gid, function(er) { |
| if (chownErOk(er)) er = null; |
| if (cb) cb.apply(this, arguments); |
| }); |
| }; |
| } |
| function chownFixSync(orig) { |
| if (!orig) return orig; |
| return function(target, uid, gid) { |
| try { |
| return orig.call(fs4, target, uid, gid); |
| } catch (er) { |
| if (!chownErOk(er)) throw er; |
| } |
| }; |
| } |
| function statFix(orig) { |
| if (!orig) return orig; |
| return function(target, options, cb) { |
| if (typeof options === "function") { |
| cb = options; |
| options = null; |
| } |
| function callback(er, stats) { |
| if (stats) { |
| if (stats.uid < 0) stats.uid += 4294967296; |
| if (stats.gid < 0) stats.gid += 4294967296; |
| } |
| if (cb) cb.apply(this, arguments); |
| } |
| return options ? orig.call(fs4, target, options, callback) : orig.call(fs4, target, callback); |
| }; |
| } |
| function statFixSync(orig) { |
| if (!orig) return orig; |
| return function(target, options) { |
| var stats = options ? orig.call(fs4, target, options) : orig.call(fs4, target); |
| if (stats) { |
| if (stats.uid < 0) stats.uid += 4294967296; |
| if (stats.gid < 0) stats.gid += 4294967296; |
| } |
| return stats; |
| }; |
| } |
| function chownErOk(er) { |
| if (!er) |
| return true; |
| if (er.code === "ENOSYS") |
| return true; |
| var nonroot = !process.getuid || process.getuid() !== 0; |
| if (nonroot) { |
| if (er.code === "EINVAL" || er.code === "EPERM") |
| return true; |
| } |
| return false; |
| } |
| } |
| } |
| }); |
| var require_legacy_streams = (0, import_chunk_QGM4M3NI.__commonJS)({ |
| "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js"(exports, module2) { |
| "use strict"; |
| var Stream = (0, import_chunk_QGM4M3NI.__require)("stream").Stream; |
| module2.exports = legacy; |
| function legacy(fs4) { |
| return { |
| ReadStream, |
| WriteStream |
| }; |
| function ReadStream(path6, options) { |
| if (!(this instanceof ReadStream)) return new ReadStream(path6, options); |
| Stream.call(this); |
| var self = this; |
| this.path = path6; |
| this.fd = null; |
| this.readable = true; |
| this.paused = false; |
| this.flags = "r"; |
| this.mode = 438; |
| this.bufferSize = 64 * 1024; |
| options = options || {}; |
| var keys = Object.keys(options); |
| for (var index = 0, length = keys.length; index < length; index++) { |
| var key = keys[index]; |
| this[key] = options[key]; |
| } |
| if (this.encoding) this.setEncoding(this.encoding); |
| if (this.start !== void 0) { |
| if ("number" !== typeof this.start) { |
| throw TypeError("start must be a Number"); |
| } |
| if (this.end === void 0) { |
| this.end = Infinity; |
| } else if ("number" !== typeof this.end) { |
| throw TypeError("end must be a Number"); |
| } |
| if (this.start > this.end) { |
| throw new Error("start must be <= end"); |
| } |
| this.pos = this.start; |
| } |
| if (this.fd !== null) { |
| process.nextTick(function() { |
| self._read(); |
| }); |
| return; |
| } |
| fs4.open(this.path, this.flags, this.mode, function(err, fd) { |
| if (err) { |
| self.emit("error", err); |
| self.readable = false; |
| return; |
| } |
| self.fd = fd; |
| self.emit("open", fd); |
| self._read(); |
| }); |
| } |
| function WriteStream(path6, options) { |
| if (!(this instanceof WriteStream)) return new WriteStream(path6, options); |
| Stream.call(this); |
| this.path = path6; |
| this.fd = null; |
| this.writable = true; |
| this.flags = "w"; |
| this.encoding = "binary"; |
| this.mode = 438; |
| this.bytesWritten = 0; |
| options = options || {}; |
| var keys = Object.keys(options); |
| for (var index = 0, length = keys.length; index < length; index++) { |
| var key = keys[index]; |
| this[key] = options[key]; |
| } |
| if (this.start !== void 0) { |
| if ("number" !== typeof this.start) { |
| throw TypeError("start must be a Number"); |
| } |
| if (this.start < 0) { |
| throw new Error("start must be >= zero"); |
| } |
| this.pos = this.start; |
| } |
| this.busy = false; |
| this._queue = []; |
| if (this.fd === null) { |
| this._open = fs4.open; |
| this._queue.push([this._open, this.path, this.flags, this.mode, void 0]); |
| this.flush(); |
| } |
| } |
| } |
| } |
| }); |
| var require_clone = (0, import_chunk_QGM4M3NI.__commonJS)({ |
| "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/clone.js"(exports, module2) { |
| "use strict"; |
| module2.exports = clone; |
| var getPrototypeOf = Object.getPrototypeOf || function(obj) { |
| return obj.__proto__; |
| }; |
| function clone(obj) { |
| if (obj === null || typeof obj !== "object") |
| return obj; |
| if (obj instanceof Object) |
| var copy = { __proto__: getPrototypeOf(obj) }; |
| else |
| var copy = Object.create(null); |
| Object.getOwnPropertyNames(obj).forEach(function(key) { |
| Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)); |
| }); |
| return copy; |
| } |
| } |
| }); |
| var require_graceful_fs = (0, import_chunk_QGM4M3NI.__commonJS)({ |
| "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js"(exports, module2) { |
| "use strict"; |
| var fs4 = (0, import_chunk_QGM4M3NI.__require)("fs"); |
| var polyfills = require_polyfills(); |
| var legacy = require_legacy_streams(); |
| var clone = require_clone(); |
| var util = (0, import_chunk_QGM4M3NI.__require)("util"); |
| var gracefulQueue; |
| var previousSymbol; |
| if (typeof Symbol === "function" && typeof Symbol.for === "function") { |
| gracefulQueue = Symbol.for("graceful-fs.queue"); |
| previousSymbol = Symbol.for("graceful-fs.previous"); |
| } else { |
| gracefulQueue = "___graceful-fs.queue"; |
| previousSymbol = "___graceful-fs.previous"; |
| } |
| function noop() { |
| } |
| function publishQueue(context, queue2) { |
| Object.defineProperty(context, gracefulQueue, { |
| get: function() { |
| return queue2; |
| } |
| }); |
| } |
| var debug2 = noop; |
| if (util.debuglog) |
| debug2 = util.debuglog("gfs4"); |
| else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) |
| debug2 = function() { |
| var m = util.format.apply(util, arguments); |
| m = "GFS4: " + m.split(/\n/).join("\nGFS4: "); |
| console.error(m); |
| }; |
| if (!fs4[gracefulQueue]) { |
| queue = global[gracefulQueue] || []; |
| publishQueue(fs4, queue); |
| fs4.close = function(fs$close) { |
| function close(fd, cb) { |
| return fs$close.call(fs4, fd, function(err) { |
| if (!err) { |
| resetQueue(); |
| } |
| if (typeof cb === "function") |
| cb.apply(this, arguments); |
| }); |
| } |
| Object.defineProperty(close, previousSymbol, { |
| value: fs$close |
| }); |
| return close; |
| }(fs4.close); |
| fs4.closeSync = function(fs$closeSync) { |
| function closeSync(fd) { |
| fs$closeSync.apply(fs4, arguments); |
| resetQueue(); |
| } |
| Object.defineProperty(closeSync, previousSymbol, { |
| value: fs$closeSync |
| }); |
| return closeSync; |
| }(fs4.closeSync); |
| if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) { |
| process.on("exit", function() { |
| debug2(fs4[gracefulQueue]); |
| (0, import_chunk_QGM4M3NI.__require)("assert").equal(fs4[gracefulQueue].length, 0); |
| }); |
| } |
| } |
| var queue; |
| if (!global[gracefulQueue]) { |
| publishQueue(global, fs4[gracefulQueue]); |
| } |
| module2.exports = patch(clone(fs4)); |
| if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs4.__patched) { |
| module2.exports = patch(fs4); |
| fs4.__patched = true; |
| } |
| function patch(fs5) { |
| polyfills(fs5); |
| fs5.gracefulify = patch; |
| fs5.createReadStream = createReadStream; |
| fs5.createWriteStream = createWriteStream; |
| var fs$readFile = fs5.readFile; |
| fs5.readFile = readFile; |
| function readFile(path6, options, cb) { |
| if (typeof options === "function") |
| cb = options, options = null; |
| return go$readFile(path6, options, cb); |
| function go$readFile(path7, options2, cb2, startTime) { |
| return fs$readFile(path7, options2, function(err) { |
| if (err && (err.code === "EMFILE" || err.code === "ENFILE")) |
| enqueue([go$readFile, [path7, options2, cb2], err, startTime || Date.now(), Date.now()]); |
| else { |
| if (typeof cb2 === "function") |
| cb2.apply(this, arguments); |
| } |
| }); |
| } |
| } |
| var fs$writeFile = fs5.writeFile; |
| fs5.writeFile = writeFile; |
| function writeFile(path6, data, options, cb) { |
| if (typeof options === "function") |
| cb = options, options = null; |
| return go$writeFile(path6, data, options, cb); |
| function go$writeFile(path7, data2, options2, cb2, startTime) { |
| return fs$writeFile(path7, data2, options2, function(err) { |
| if (err && (err.code === "EMFILE" || err.code === "ENFILE")) |
| enqueue([go$writeFile, [path7, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); |
| else { |
| if (typeof cb2 === "function") |
| cb2.apply(this, arguments); |
| } |
| }); |
| } |
| } |
| var fs$appendFile = fs5.appendFile; |
| if (fs$appendFile) |
| fs5.appendFile = appendFile; |
| function appendFile(path6, data, options, cb) { |
| if (typeof options === "function") |
| cb = options, options = null; |
| return go$appendFile(path6, data, options, cb); |
| function go$appendFile(path7, data2, options2, cb2, startTime) { |
| return fs$appendFile(path7, data2, options2, function(err) { |
| if (err && (err.code === "EMFILE" || err.code === "ENFILE")) |
| enqueue([go$appendFile, [path7, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); |
| else { |
| if (typeof cb2 === "function") |
| cb2.apply(this, arguments); |
| } |
| }); |
| } |
| } |
| var fs$copyFile = fs5.copyFile; |
| if (fs$copyFile) |
| fs5.copyFile = copyFile; |
| function copyFile(src, dest, flags, cb) { |
| if (typeof flags === "function") { |
| cb = flags; |
| flags = 0; |
| } |
| return go$copyFile(src, dest, flags, cb); |
| function go$copyFile(src2, dest2, flags2, cb2, startTime) { |
| return fs$copyFile(src2, dest2, flags2, function(err) { |
| if (err && (err.code === "EMFILE" || err.code === "ENFILE")) |
| enqueue([go$copyFile, [src2, dest2, flags2, cb2], err, startTime || Date.now(), Date.now()]); |
| else { |
| if (typeof cb2 === "function") |
| cb2.apply(this, arguments); |
| } |
| }); |
| } |
| } |
| var fs$readdir = fs5.readdir; |
| fs5.readdir = readdir; |
| var noReaddirOptionVersions = /^v[0-5]\./; |
| function readdir(path6, options, cb) { |
| if (typeof options === "function") |
| cb = options, options = null; |
| var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path7, options2, cb2, startTime) { |
| return fs$readdir(path7, fs$readdirCallback( |
| path7, |
| options2, |
| cb2, |
| startTime |
| )); |
| } : function go$readdir2(path7, options2, cb2, startTime) { |
| return fs$readdir(path7, options2, fs$readdirCallback( |
| path7, |
| options2, |
| cb2, |
| startTime |
| )); |
| }; |
| return go$readdir(path6, options, cb); |
| function fs$readdirCallback(path7, options2, cb2, startTime) { |
| return function(err, files) { |
| if (err && (err.code === "EMFILE" || err.code === "ENFILE")) |
| enqueue([ |
| go$readdir, |
| [path7, options2, cb2], |
| err, |
| startTime || Date.now(), |
| Date.now() |
| ]); |
| else { |
| if (files && files.sort) |
| files.sort(); |
| if (typeof cb2 === "function") |
| cb2.call(this, err, files); |
| } |
| }; |
| } |
| } |
| if (process.version.substr(0, 4) === "v0.8") { |
| var legStreams = legacy(fs5); |
| ReadStream = legStreams.ReadStream; |
| WriteStream = legStreams.WriteStream; |
| } |
| var fs$ReadStream = fs5.ReadStream; |
| if (fs$ReadStream) { |
| ReadStream.prototype = Object.create(fs$ReadStream.prototype); |
| ReadStream.prototype.open = ReadStream$open; |
| } |
| var fs$WriteStream = fs5.WriteStream; |
| if (fs$WriteStream) { |
| WriteStream.prototype = Object.create(fs$WriteStream.prototype); |
| WriteStream.prototype.open = WriteStream$open; |
| } |
| Object.defineProperty(fs5, "ReadStream", { |
| get: function() { |
| return ReadStream; |
| }, |
| set: function(val) { |
| ReadStream = val; |
| }, |
| enumerable: true, |
| configurable: true |
| }); |
| Object.defineProperty(fs5, "WriteStream", { |
| get: function() { |
| return WriteStream; |
| }, |
| set: function(val) { |
| WriteStream = val; |
| }, |
| enumerable: true, |
| configurable: true |
| }); |
| var FileReadStream = ReadStream; |
| Object.defineProperty(fs5, "FileReadStream", { |
| get: function() { |
| return FileReadStream; |
| }, |
| set: function(val) { |
| FileReadStream = val; |
| }, |
| enumerable: true, |
| configurable: true |
| }); |
| var FileWriteStream = WriteStream; |
| Object.defineProperty(fs5, "FileWriteStream", { |
| get: function() { |
| return FileWriteStream; |
| }, |
| set: function(val) { |
| FileWriteStream = val; |
| }, |
| enumerable: true, |
| configurable: true |
| }); |
| function ReadStream(path6, options) { |
| if (this instanceof ReadStream) |
| return fs$ReadStream.apply(this, arguments), this; |
| else |
| return ReadStream.apply(Object.create(ReadStream.prototype), arguments); |
| } |
| function ReadStream$open() { |
| var that = this; |
| open(that.path, that.flags, that.mode, function(err, fd) { |
| if (err) { |
| if (that.autoClose) |
| that.destroy(); |
| that.emit("error", err); |
| } else { |
| that.fd = fd; |
| that.emit("open", fd); |
| that.read(); |
| } |
| }); |
| } |
| function WriteStream(path6, options) { |
| if (this instanceof WriteStream) |
| return fs$WriteStream.apply(this, arguments), this; |
| else |
| return WriteStream.apply(Object.create(WriteStream.prototype), arguments); |
| } |
| function WriteStream$open() { |
| var that = this; |
| open(that.path, that.flags, that.mode, function(err, fd) { |
| if (err) { |
| that.destroy(); |
| that.emit("error", err); |
| } else { |
| that.fd = fd; |
| that.emit("open", fd); |
| } |
| }); |
| } |
| function createReadStream(path6, options) { |
| return new fs5.ReadStream(path6, options); |
| } |
| function createWriteStream(path6, options) { |
| return new fs5.WriteStream(path6, options); |
| } |
| var fs$open = fs5.open; |
| fs5.open = open; |
| function open(path6, flags, mode, cb) { |
| if (typeof mode === "function") |
| cb = mode, mode = null; |
| return go$open(path6, flags, mode, cb); |
| function go$open(path7, flags2, mode2, cb2, startTime) { |
| return fs$open(path7, flags2, mode2, function(err, fd) { |
| if (err && (err.code === "EMFILE" || err.code === "ENFILE")) |
| enqueue([go$open, [path7, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]); |
| else { |
| if (typeof cb2 === "function") |
| cb2.apply(this, arguments); |
| } |
| }); |
| } |
| } |
| return fs5; |
| } |
| function enqueue(elem) { |
| debug2("ENQUEUE", elem[0].name, elem[1]); |
| fs4[gracefulQueue].push(elem); |
| retry(); |
| } |
| var retryTimer; |
| function resetQueue() { |
| var now = Date.now(); |
| for (var i = 0; i < fs4[gracefulQueue].length; ++i) { |
| if (fs4[gracefulQueue][i].length > 2) { |
| fs4[gracefulQueue][i][3] = now; |
| fs4[gracefulQueue][i][4] = now; |
| } |
| } |
| retry(); |
| } |
| function retry() { |
| clearTimeout(retryTimer); |
| retryTimer = void 0; |
| if (fs4[gracefulQueue].length === 0) |
| return; |
| var elem = fs4[gracefulQueue].shift(); |
| var fn = elem[0]; |
| var args = elem[1]; |
| var err = elem[2]; |
| var startTime = elem[3]; |
| var lastTime = elem[4]; |
| if (startTime === void 0) { |
| debug2("RETRY", fn.name, args); |
| fn.apply(null, args); |
| } else if (Date.now() - startTime >= 6e4) { |
| debug2("TIMEOUT", fn.name, args); |
| var cb = args.pop(); |
| if (typeof cb === "function") |
| cb.call(null, err); |
| } else { |
| var sinceAttempt = Date.now() - lastTime; |
| var sinceStart = Math.max(lastTime - startTime, 1); |
| var desiredDelay = Math.min(sinceStart * 1.2, 100); |
| if (sinceAttempt >= desiredDelay) { |
| debug2("RETRY", fn.name, args); |
| fn.apply(null, args.concat([startTime])); |
| } else { |
| fs4[gracefulQueue].push(elem); |
| } |
| } |
| if (retryTimer === void 0) { |
| retryTimer = setTimeout(retry, 0); |
| } |
| } |
| } |
| }); |
| var require_fs = (0, import_chunk_QGM4M3NI.__commonJS)({ |
| "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/fs/index.js"(exports) { |
| "use strict"; |
| var u = require_universalify().fromCallback; |
| var fs4 = require_graceful_fs(); |
| var api = [ |
| "access", |
| "appendFile", |
| "chmod", |
| "chown", |
| "close", |
| "copyFile", |
| "cp", |
| "fchmod", |
| "fchown", |
| "fdatasync", |
| "fstat", |
| "fsync", |
| "ftruncate", |
| "futimes", |
| "glob", |
| "lchmod", |
| "lchown", |
| "lutimes", |
| "link", |
| "lstat", |
| "mkdir", |
| "mkdtemp", |
| "open", |
| "opendir", |
| "readdir", |
| "readFile", |
| "readlink", |
| "realpath", |
| "rename", |
| "rm", |
| "rmdir", |
| "stat", |
| "statfs", |
| "symlink", |
| "truncate", |
| "unlink", |
| "utimes", |
| "writeFile" |
| ].filter((key) => { |
| return typeof fs4[key] === "function"; |
| }); |
| Object.assign(exports, fs4); |
| api.forEach((method) => { |
| exports[method] = u(fs4[method]); |
| }); |
| exports.exists = function(filename, callback) { |
| if (typeof callback === "function") { |
| return fs4.exists(filename, callback); |
| } |
| return new Promise((resolve) => { |
| return fs4.exists(filename, resolve); |
| }); |
| }; |
| exports.read = function(fd, buffer, offset, length, position, callback) { |
| if (typeof callback === "function") { |
| return fs4.read(fd, buffer, offset, length, position, callback); |
| } |
| return new Promise((resolve, reject) => { |
| fs4.read(fd, buffer, offset, length, position, (err, bytesRead, buffer2) => { |
| if (err) return reject(err); |
| resolve({ bytesRead, buffer: buffer2 }); |
| }); |
| }); |
| }; |
| exports.write = function(fd, buffer, ...args) { |
| if (typeof args[args.length - 1] === "function") { |
| return fs4.write(fd, buffer, ...args); |
| } |
| return new Promise((resolve, reject) => { |
| fs4.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => { |
| if (err) return reject(err); |
| resolve({ bytesWritten, buffer: buffer2 }); |
| }); |
| }); |
| }; |
| exports.readv = function(fd, buffers, ...args) { |
| if (typeof args[args.length - 1] === "function") { |
| return fs4.readv(fd, buffers, ...args); |
| } |
| return new Promise((resolve, reject) => { |
| fs4.readv(fd, buffers, ...args, (err, bytesRead, buffers2) => { |
| if (err) return reject(err); |
| resolve({ bytesRead, buffers: buffers2 }); |
| }); |
| }); |
| }; |
| exports.writev = function(fd, buffers, ...args) { |
| if (typeof args[args.length - 1] === "function") { |
| return fs4.writev(fd, buffers, ...args); |
| } |
| return new Promise((resolve, reject) => { |
| fs4.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => { |
| if (err) return reject(err); |
| resolve({ bytesWritten, buffers: buffers2 }); |
| }); |
| }); |
| }; |
| if (typeof fs4.realpath.native === "function") { |
| exports.realpath.native = u(fs4.realpath.native); |
| } else { |
| process.emitWarning( |
| "fs.realpath.native is not a function. Is fs being monkey-patched?", |
| "Warning", |
| "fs-extra-WARN0003" |
| ); |
| } |
| } |
| }); |
| var require_utils = (0, import_chunk_QGM4M3NI.__commonJS)({ |
| "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/mkdirs/utils.js"(exports, module2) { |
| "use strict"; |
| var path6 = (0, import_chunk_QGM4M3NI.__require)("path"); |
| module2.exports.checkPath = function checkPath(pth) { |
| if (process.platform === "win32") { |
| const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path6.parse(pth).root, "")); |
| if (pathHasInvalidWinCharacters) { |
| const error = new Error(`Path contains invalid characters: ${pth}`); |
| error.code = "EINVAL"; |
| throw error; |
| } |
| } |
| }; |
| } |
| }); |
| var require_make_dir = (0, import_chunk_QGM4M3NI.__commonJS)({ |
| "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports, module2) { |
| "use strict"; |
| var fs4 = require_fs(); |
| var { checkPath } = require_utils(); |
| var getMode = (options) => { |
| const defaults = { mode: 511 }; |
| if (typeof options === "number") return options; |
| return { ...defaults, ...options }.mode; |
| }; |
| module2.exports.makeDir = async (dir, options) => { |
| checkPath(dir); |
| return fs4.mkdir(dir, { |
| mode: getMode(options), |
| recursive: true |
| }); |
| }; |
| module2.exports.makeDirSync = (dir, options) => { |
| checkPath(dir); |
| return fs4.mkdirSync(dir, { |
| mode: getMode(options), |
| recursive: true |
| }); |
| }; |
| } |
| }); |
| var require_mkdirs = (0, import_chunk_QGM4M3NI.__commonJS)({ |
| "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/mkdirs/index.js"(exports, module2) { |
| "use strict"; |
| var u = require_universalify().fromPromise; |
| var { makeDir: _makeDir, makeDirSync } = require_make_dir(); |
| var makeDir = u(_makeDir); |
| module2.exports = { |
| mkdirs: makeDir, |
| mkdirsSync: makeDirSync, |
| |
| mkdirp: makeDir, |
| mkdirpSync: makeDirSync, |
| ensureDir: makeDir, |
| ensureDirSync: makeDirSync |
| }; |
| } |
| }); |
| var require_path_exists = (0, import_chunk_QGM4M3NI.__commonJS)({ |
| "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/path-exists/index.js"(exports, module2) { |
| "use strict"; |
| var u = require_universalify().fromPromise; |
| var fs4 = require_fs(); |
| function pathExists2(path6) { |
| return fs4.access(path6).then(() => true).catch(() => false); |
| } |
| module2.exports = { |
| pathExists: u(pathExists2), |
| pathExistsSync: fs4.existsSync |
| }; |
| } |
| }); |
| var require_utimes = (0, import_chunk_QGM4M3NI.__commonJS)({ |
| "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/util/utimes.js"(exports, module2) { |
| "use strict"; |
| var fs4 = require_fs(); |
| var u = require_universalify().fromPromise; |
| async function utimesMillis(path6, atime, mtime) { |
| const fd = await fs4.open(path6, "r+"); |
| let closeErr = null; |
| try { |
| await fs4.futimes(fd, atime, mtime); |
| } finally { |
| try { |
| await fs4.close(fd); |
| } catch (e) { |
| closeErr = e; |
| } |
| } |
| if (closeErr) { |
| throw closeErr; |
| } |
| } |
| function utimesMillisSync(path6, atime, mtime) { |
| const fd = fs4.openSync(path6, "r+"); |
| fs4.futimesSync(fd, atime, mtime); |
| return fs4.closeSync(fd); |
| } |
| module2.exports = { |
| utimesMillis: u(utimesMillis), |
| utimesMillisSync |
| }; |
| } |
| }); |
| var require_stat = (0, import_chunk_QGM4M3NI.__commonJS)({ |
| "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/util/stat.js"(exports, module2) { |
| "use strict"; |
| var fs4 = require_fs(); |
| var path6 = (0, import_chunk_QGM4M3NI.__require)("path"); |
| var u = require_universalify().fromPromise; |
| function getStats(src, dest, opts) { |
| const statFunc = opts.dereference ? (file) => fs4.stat(file, { bigint: true }) : (file) => fs4.lstat(file, { bigint: true }); |
| return Promise.all([ |
| statFunc(src), |
| statFunc(dest).catch((err) => { |
| if (err.code === "ENOENT") return null; |
| throw err; |
| }) |
| ]).then(([srcStat, destStat]) => ({ srcStat, destStat })); |
| } |
| function getStatsSync(src, dest, opts) { |
| let destStat; |
| const statFunc = opts.dereference ? (file) => fs4.statSync(file, { bigint: true }) : (file) => fs4.lstatSync(file, { bigint: true }); |
| const srcStat = statFunc(src); |
| try { |
| destStat = statFunc(dest); |
| } catch (err) { |
| if (err.code === "ENOENT") return { srcStat, destStat: null }; |
| throw err; |
| } |
| return { srcStat, destStat }; |
| } |
| async function checkPaths(src, dest, funcName, opts) { |
| const { srcStat, destStat } = await getStats(src, dest, opts); |
| if (destStat) { |
| if (areIdentical(srcStat, destStat)) { |
| const srcBaseName = path6.basename(src); |
| const destBaseName = path6.basename(dest); |
| if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) { |
| return { srcStat, destStat, isChangingCase: true }; |
| } |
| throw new Error("Source and destination must not be the same."); |
| } |
| if (srcStat.isDirectory() && !destStat.isDirectory()) { |
| throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`); |
| } |
| if (!srcStat.isDirectory() && destStat.isDirectory()) { |
| throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`); |
| } |
| } |
| if (srcStat.isDirectory() && isSrcSubdir(src, dest)) { |
| throw new Error(errMsg(src, dest, funcName)); |
| } |
| return { srcStat, destStat }; |
| } |
| function checkPathsSync(src, dest, funcName, opts) { |
| const { srcStat, destStat } = getStatsSync(src, dest, opts); |
| if (destStat) { |
| if (areIdentical(srcStat, destStat)) { |
| const srcBaseName = path6.basename(src); |
| const destBaseName = path6.basename(dest); |
| if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) { |
| return { srcStat, destStat, isChangingCase: true }; |
| } |
| throw new Error("Source and destination must not be the same."); |
| } |
| if (srcStat.isDirectory() && !destStat.isDirectory()) { |
| throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`); |
| } |
| if (!srcStat.isDirectory() && destStat.isDirectory()) { |
| throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`); |
| } |
| } |
| if (srcStat.isDirectory() && isSrcSubdir(src, dest)) { |
| throw new Error(errMsg(src, dest, funcName)); |
| } |
| return { srcStat, destStat }; |
| } |
| async function checkParentPaths(src, srcStat, dest, funcName) { |
| const srcParent = path6.resolve(path6.dirname(src)); |
| const destParent = path6.resolve(path6.dirname(dest)); |
| if (destParent === srcParent || destParent === path6.parse(destParent).root) return; |
| let destStat; |
| try { |
| destStat = await fs4.stat(destParent, { bigint: true }); |
| } catch (err) { |
| if (err.code === "ENOENT") return; |
| throw err; |
| } |
| if (areIdentical(srcStat, destStat)) { |
| throw new Error(errMsg(src, dest, funcName)); |
| } |
| return checkParentPaths(src, srcStat, destParent, funcName); |
| } |
| function checkParentPathsSync(src, srcStat, dest, funcName) { |
| const srcParent = path6.resolve(path6.dirname(src)); |
| const destParent = path6.resolve(path6.dirname(dest)); |
| if (destParent === srcParent || destParent === path6.parse(destParent).root) return; |
| let destStat; |
| try { |
| destStat = fs4.statSync(destParent, { bigint: true }); |
| } catch (err) { |
| if (err.code === "ENOENT") return; |
| throw err; |
| } |
| if (areIdentical(srcStat, destStat)) { |
| throw new Error(errMsg(src, dest, funcName)); |
| } |
| return checkParentPathsSync(src, srcStat, destParent, funcName); |
| } |
| function areIdentical(srcStat, destStat) { |
| return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev; |
| } |
| function isSrcSubdir(src, dest) { |
| const srcArr = path6.resolve(src).split(path6.sep).filter((i) => i); |
| const destArr = path6.resolve(dest).split(path6.sep).filter((i) => i); |
| return srcArr.every((cur, i) => destArr[i] === cur); |
| } |
| function errMsg(src, dest, funcName) { |
| return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`; |
| } |
| module2.exports = { |
| |
| checkPaths: u(checkPaths), |
| checkPathsSync, |
| |
| checkParentPaths: u(checkParentPaths), |
| checkParentPathsSync, |
| |
| isSrcSubdir, |
| areIdentical |
| }; |
| } |
| }); |
| var require_copy = (0, import_chunk_QGM4M3NI.__commonJS)({ |
| "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/copy/copy.js"(exports, module2) { |
| "use strict"; |
| var fs4 = require_fs(); |
| var path6 = (0, import_chunk_QGM4M3NI.__require)("path"); |
| var { mkdirs } = require_mkdirs(); |
| var { pathExists: pathExists2 } = require_path_exists(); |
| var { utimesMillis } = require_utimes(); |
| var stat = require_stat(); |
| async function copy(src, dest, opts = {}) { |
| if (typeof opts === "function") { |
| opts = { filter: opts }; |
| } |
| opts.clobber = "clobber" in opts ? !!opts.clobber : true; |
| opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber; |
| 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" |
| ); |
| } |
| const { srcStat, destStat } = await stat.checkPaths(src, dest, "copy", opts); |
| await stat.checkParentPaths(src, srcStat, dest, "copy"); |
| const include = await runFilter(src, dest, opts); |
| if (!include) return; |
| const destParent = path6.dirname(dest); |
| const dirExists = await pathExists2(destParent); |
| if (!dirExists) { |
| await mkdirs(destParent); |
| } |
| await getStatsAndPerformCopy(destStat, src, dest, opts); |
| } |
| async function runFilter(src, dest, opts) { |
| if (!opts.filter) return true; |
| return opts.filter(src, dest); |
| } |
| async function getStatsAndPerformCopy(destStat, src, dest, opts) { |
| const statFn = opts.dereference ? fs4.stat : fs4.lstat; |
| const srcStat = await statFn(src); |
| if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts); |
| if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts); |
| if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts); |
| if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`); |
| if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`); |
| throw new Error(`Unknown file: ${src}`); |
| } |
| async function onFile(srcStat, destStat, src, dest, opts) { |
| if (!destStat) return copyFile(srcStat, src, dest, opts); |
| if (opts.overwrite) { |
| await fs4.unlink(dest); |
| return copyFile(srcStat, src, dest, opts); |
| } |
| if (opts.errorOnExist) { |
| throw new Error(`'${dest}' already exists`); |
| } |
| } |
| async function copyFile(srcStat, src, dest, opts) { |
| await fs4.copyFile(src, dest); |
| if (opts.preserveTimestamps) { |
| if (fileIsNotWritable(srcStat.mode)) { |
| await makeFileWritable(dest, srcStat.mode); |
| } |
| const updatedSrcStat = await fs4.stat(src); |
| await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime); |
| } |
| return fs4.chmod(dest, srcStat.mode); |
| } |
| function fileIsNotWritable(srcMode) { |
| return (srcMode & 128) === 0; |
| } |
| function makeFileWritable(dest, srcMode) { |
| return fs4.chmod(dest, srcMode | 128); |
| } |
| async function onDir(srcStat, destStat, src, dest, opts) { |
| if (!destStat) { |
| await fs4.mkdir(dest); |
| } |
| const promises = []; |
| for await (const item of await fs4.opendir(src)) { |
| const srcItem = path6.join(src, item.name); |
| const destItem = path6.join(dest, item.name); |
| promises.push( |
| runFilter(srcItem, destItem, opts).then((include) => { |
| if (include) { |
| return stat.checkPaths(srcItem, destItem, "copy", opts).then(({ destStat: destStat2 }) => { |
| return getStatsAndPerformCopy(destStat2, srcItem, destItem, opts); |
| }); |
| } |
| }) |
| ); |
| } |
| await Promise.all(promises); |
| if (!destStat) { |
| await fs4.chmod(dest, srcStat.mode); |
| } |
| } |
| async function onLink(destStat, src, dest, opts) { |
| let resolvedSrc = await fs4.readlink(src); |
| if (opts.dereference) { |
| resolvedSrc = path6.resolve(process.cwd(), resolvedSrc); |
| } |
| if (!destStat) { |
| return fs4.symlink(resolvedSrc, dest); |
| } |
| let resolvedDest = null; |
| try { |
| resolvedDest = await fs4.readlink(dest); |
| } catch (e) { |
| if (e.code === "EINVAL" || e.code === "UNKNOWN") return fs4.symlink(resolvedSrc, dest); |
| throw e; |
| } |
| if (opts.dereference) { |
| resolvedDest = path6.resolve(process.cwd(), resolvedDest); |
| } |
| if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) { |
| throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`); |
| } |
| if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) { |
| throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`); |
| } |
| await fs4.unlink(dest); |
| return fs4.symlink(resolvedSrc, dest); |
| } |
| module2.exports = copy; |
| } |
| }); |
| var require_copy_sync = (0, import_chunk_QGM4M3NI.__commonJS)({ |
| "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/copy/copy-sync.js"(exports, module2) { |
| "use strict"; |
| var fs4 = require_graceful_fs(); |
| var path6 = (0, import_chunk_QGM4M3NI.__require)("path"); |
| var mkdirsSync = require_mkdirs().mkdirsSync; |
| var utimesMillisSync = require_utimes().utimesMillisSync; |
| var stat = require_stat(); |
| function copySync(src, dest, opts) { |
| if (typeof opts === "function") { |
| opts = { filter: opts }; |
| } |
| opts = opts || {}; |
| opts.clobber = "clobber" in opts ? !!opts.clobber : true; |
| opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber; |
| 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" |
| ); |
| } |
| const { srcStat, destStat } = stat.checkPathsSync(src, dest, "copy", opts); |
| stat.checkParentPathsSync(src, srcStat, dest, "copy"); |
| if (opts.filter && !opts.filter(src, dest)) return; |
| const destParent = path6.dirname(dest); |
| if (!fs4.existsSync(destParent)) mkdirsSync(destParent); |
| return getStats(destStat, src, dest, opts); |
| } |
| function getStats(destStat, src, dest, opts) { |
| const statSync = opts.dereference ? fs4.statSync : fs4.lstatSync; |
| const srcStat = statSync(src); |
| if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts); |
| else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts); |
| else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts); |
| else if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`); |
| else if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`); |
| throw new Error(`Unknown file: ${src}`); |
| } |
| function onFile(srcStat, destStat, src, dest, opts) { |
| if (!destStat) return copyFile(srcStat, src, dest, opts); |
| return mayCopyFile(srcStat, src, dest, opts); |
| } |
| function mayCopyFile(srcStat, src, dest, opts) { |
| if (opts.overwrite) { |
| fs4.unlinkSync(dest); |
| return copyFile(srcStat, src, dest, opts); |
| } else if (opts.errorOnExist) { |
| throw new Error(`'${dest}' already exists`); |
| } |
| } |
| function copyFile(srcStat, src, dest, opts) { |
| fs4.copyFileSync(src, dest); |
| if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest); |
| return setDestMode(dest, srcStat.mode); |
| } |
| function handleTimestamps(srcMode, src, dest) { |
| if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode); |
| return setDestTimestamps(src, dest); |
| } |
| function fileIsNotWritable(srcMode) { |
| return (srcMode & 128) === 0; |
| } |
| function makeFileWritable(dest, srcMode) { |
| return setDestMode(dest, srcMode | 128); |
| } |
| function setDestMode(dest, srcMode) { |
| return fs4.chmodSync(dest, srcMode); |
| } |
| function setDestTimestamps(src, dest) { |
| const updatedSrcStat = fs4.statSync(src); |
| return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime); |
| } |
| function onDir(srcStat, destStat, src, dest, opts) { |
| if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts); |
| return copyDir(src, dest, opts); |
| } |
| function mkDirAndCopy(srcMode, src, dest, opts) { |
| fs4.mkdirSync(dest); |
| copyDir(src, dest, opts); |
| return setDestMode(dest, srcMode); |
| } |
| function copyDir(src, dest, opts) { |
| const dir = fs4.opendirSync(src); |
| try { |
| let dirent; |
| while ((dirent = dir.readSync()) !== null) { |
| copyDirItem(dirent.name, src, dest, opts); |
| } |
| } finally { |
| dir.closeSync(); |
| } |
| } |
| function copyDirItem(item, src, dest, opts) { |
| const srcItem = path6.join(src, item); |
| const destItem = path6.join(dest, item); |
| if (opts.filter && !opts.filter(srcItem, destItem)) return; |
| const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy", opts); |
| return getStats(destStat, srcItem, destItem, opts); |
| } |
| function onLink(destStat, src, dest, opts) { |
| let resolvedSrc = fs4.readlinkSync(src); |
| if (opts.dereference) { |
| resolvedSrc = path6.resolve(process.cwd(), resolvedSrc); |
| } |
| if (!destStat) { |
| return fs4.symlinkSync(resolvedSrc, dest); |
| } else { |
| let resolvedDest; |
| try { |
| resolvedDest = fs4.readlinkSync(dest); |
| } catch (err) { |
| if (err.code === "EINVAL" || err.code === "UNKNOWN") return fs4.symlinkSync(resolvedSrc, dest); |
| throw err; |
| } |
| if (opts.dereference) { |
| resolvedDest = path6.resolve(process.cwd(), resolvedDest); |
| } |
| if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) { |
| throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`); |
| } |
| if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) { |
| throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`); |
| } |
| return copyLink(resolvedSrc, dest); |
| } |
| } |
| function copyLink(resolvedSrc, dest) { |
| fs4.unlinkSync(dest); |
| return fs4.symlinkSync(resolvedSrc, dest); |
| } |
| module2.exports = copySync; |
| } |
| }); |
| var require_copy2 = (0, import_chunk_QGM4M3NI.__commonJS)({ |
| "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/copy/index.js"(exports, module2) { |
| "use strict"; |
| var u = require_universalify().fromPromise; |
| module2.exports = { |
| copy: u(require_copy()), |
| copySync: require_copy_sync() |
| }; |
| } |
| }); |
| var require_remove = (0, import_chunk_QGM4M3NI.__commonJS)({ |
| "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/remove/index.js"(exports, module2) { |
| "use strict"; |
| var fs4 = require_graceful_fs(); |
| var u = require_universalify().fromCallback; |
| function remove(path6, callback) { |
| fs4.rm(path6, { recursive: true, force: true }, callback); |
| } |
| function removeSync(path6) { |
| fs4.rmSync(path6, { recursive: true, force: true }); |
| } |
| module2.exports = { |
| remove: u(remove), |
| removeSync |
| }; |
| } |
| }); |
| var require_empty = (0, import_chunk_QGM4M3NI.__commonJS)({ |
| "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/empty/index.js"(exports, module2) { |
| "use strict"; |
| var u = require_universalify().fromPromise; |
| var fs4 = require_fs(); |
| var path6 = (0, import_chunk_QGM4M3NI.__require)("path"); |
| var mkdir = require_mkdirs(); |
| var remove = require_remove(); |
| var emptyDir = u(async function emptyDir2(dir) { |
| let items; |
| try { |
| items = await fs4.readdir(dir); |
| } catch { |
| return mkdir.mkdirs(dir); |
| } |
| return Promise.all(items.map((item) => remove.remove(path6.join(dir, item)))); |
| }); |
| function emptyDirSync(dir) { |
| let items; |
| try { |
| items = fs4.readdirSync(dir); |
| } catch { |
| return mkdir.mkdirsSync(dir); |
| } |
| items.forEach((item) => { |
| item = path6.join(dir, item); |
| remove.removeSync(item); |
| }); |
| } |
| module2.exports = { |
| emptyDirSync, |
| emptydirSync: emptyDirSync, |
| emptyDir, |
| emptydir: emptyDir |
| }; |
| } |
| }); |
| var require_file = (0, import_chunk_QGM4M3NI.__commonJS)({ |
| "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/ensure/file.js"(exports, module2) { |
| "use strict"; |
| var u = require_universalify().fromPromise; |
| var path6 = (0, import_chunk_QGM4M3NI.__require)("path"); |
| var fs4 = require_fs(); |
| var mkdir = require_mkdirs(); |
| async function createFile(file) { |
| let stats; |
| try { |
| stats = await fs4.stat(file); |
| } catch { |
| } |
| if (stats && stats.isFile()) return; |
| const dir = path6.dirname(file); |
| let dirStats = null; |
| try { |
| dirStats = await fs4.stat(dir); |
| } catch (err) { |
| if (err.code === "ENOENT") { |
| await mkdir.mkdirs(dir); |
| await fs4.writeFile(file, ""); |
| return; |
| } else { |
| throw err; |
| } |
| } |
| if (dirStats.isDirectory()) { |
| await fs4.writeFile(file, ""); |
| } else { |
| await fs4.readdir(dir); |
| } |
| } |
| function createFileSync(file) { |
| let stats; |
| try { |
| stats = fs4.statSync(file); |
| } catch { |
| } |
| if (stats && stats.isFile()) return; |
| const dir = path6.dirname(file); |
| try { |
| if (!fs4.statSync(dir).isDirectory()) { |
| fs4.readdirSync(dir); |
| } |
| } catch (err) { |
| if (err && err.code === "ENOENT") mkdir.mkdirsSync(dir); |
| else throw err; |
| } |
| fs4.writeFileSync(file, ""); |
| } |
| module2.exports = { |
| createFile: u(createFile), |
| createFileSync |
| }; |
| } |
| }); |
| var require_link = (0, import_chunk_QGM4M3NI.__commonJS)({ |
| "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/ensure/link.js"(exports, module2) { |
| "use strict"; |
| var u = require_universalify().fromPromise; |
| var path6 = (0, import_chunk_QGM4M3NI.__require)("path"); |
| var fs4 = require_fs(); |
| var mkdir = require_mkdirs(); |
| var { pathExists: pathExists2 } = require_path_exists(); |
| var { areIdentical } = require_stat(); |
| async function createLink(srcpath, dstpath) { |
| let dstStat; |
| try { |
| dstStat = await fs4.lstat(dstpath); |
| } catch { |
| } |
| let srcStat; |
| try { |
| srcStat = await fs4.lstat(srcpath); |
| } catch (err) { |
| err.message = err.message.replace("lstat", "ensureLink"); |
| throw err; |
| } |
| if (dstStat && areIdentical(srcStat, dstStat)) return; |
| const dir = path6.dirname(dstpath); |
| const dirExists = await pathExists2(dir); |
| if (!dirExists) { |
| await mkdir.mkdirs(dir); |
| } |
| await fs4.link(srcpath, dstpath); |
| } |
| function createLinkSync(srcpath, dstpath) { |
| let dstStat; |
| try { |
| dstStat = fs4.lstatSync(dstpath); |
| } catch { |
| } |
| try { |
| const srcStat = fs4.lstatSync(srcpath); |
| if (dstStat && areIdentical(srcStat, dstStat)) return; |
| } catch (err) { |
| err.message = err.message.replace("lstat", "ensureLink"); |
| throw err; |
| } |
| const dir = path6.dirname(dstpath); |
| const dirExists = fs4.existsSync(dir); |
| if (dirExists) return fs4.linkSync(srcpath, dstpath); |
| mkdir.mkdirsSync(dir); |
| return fs4.linkSync(srcpath, dstpath); |
| } |
| module2.exports = { |
| createLink: u(createLink), |
| createLinkSync |
| }; |
| } |
| }); |
| var require_symlink_paths = (0, import_chunk_QGM4M3NI.__commonJS)({ |
| "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports, module2) { |
| "use strict"; |
| var path6 = (0, import_chunk_QGM4M3NI.__require)("path"); |
| var fs4 = require_fs(); |
| var { pathExists: pathExists2 } = require_path_exists(); |
| var u = require_universalify().fromPromise; |
| async function symlinkPaths(srcpath, dstpath) { |
| if (path6.isAbsolute(srcpath)) { |
| try { |
| await fs4.lstat(srcpath); |
| } catch (err) { |
| err.message = err.message.replace("lstat", "ensureSymlink"); |
| throw err; |
| } |
| return { |
| toCwd: srcpath, |
| toDst: srcpath |
| }; |
| } |
| const dstdir = path6.dirname(dstpath); |
| const relativeToDst = path6.join(dstdir, srcpath); |
| const exists = await pathExists2(relativeToDst); |
| if (exists) { |
| return { |
| toCwd: relativeToDst, |
| toDst: srcpath |
| }; |
| } |
| try { |
| await fs4.lstat(srcpath); |
| } catch (err) { |
| err.message = err.message.replace("lstat", "ensureSymlink"); |
| throw err; |
| } |
| return { |
| toCwd: srcpath, |
| toDst: path6.relative(dstdir, srcpath) |
| }; |
| } |
| function symlinkPathsSync(srcpath, dstpath) { |
| if (path6.isAbsolute(srcpath)) { |
| const exists2 = fs4.existsSync(srcpath); |
| if (!exists2) throw new Error("absolute srcpath does not exist"); |
| return { |
| toCwd: srcpath, |
| toDst: srcpath |
| }; |
| } |
| const dstdir = path6.dirname(dstpath); |
| const relativeToDst = path6.join(dstdir, srcpath); |
| const exists = fs4.existsSync(relativeToDst); |
| if (exists) { |
| return { |
| toCwd: relativeToDst, |
| toDst: srcpath |
| }; |
| } |
| const srcExists = fs4.existsSync(srcpath); |
| if (!srcExists) throw new Error("relative srcpath does not exist"); |
| return { |
| toCwd: srcpath, |
| toDst: path6.relative(dstdir, srcpath) |
| }; |
| } |
| module2.exports = { |
| symlinkPaths: u(symlinkPaths), |
| symlinkPathsSync |
| }; |
| } |
| }); |
| var require_symlink_type = (0, import_chunk_QGM4M3NI.__commonJS)({ |
| "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/ensure/symlink-type.js"(exports, module2) { |
| "use strict"; |
| var fs4 = require_fs(); |
| var u = require_universalify().fromPromise; |
| async function symlinkType(srcpath, type) { |
| if (type) return type; |
| let stats; |
| try { |
| stats = await fs4.lstat(srcpath); |
| } catch { |
| return "file"; |
| } |
| return stats && stats.isDirectory() ? "dir" : "file"; |
| } |
| function symlinkTypeSync(srcpath, type) { |
| if (type) return type; |
| let stats; |
| try { |
| stats = fs4.lstatSync(srcpath); |
| } catch { |
| return "file"; |
| } |
| return stats && stats.isDirectory() ? "dir" : "file"; |
| } |
| module2.exports = { |
| symlinkType: u(symlinkType), |
| symlinkTypeSync |
| }; |
| } |
| }); |
| var require_symlink = (0, import_chunk_QGM4M3NI.__commonJS)({ |
| "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/ensure/symlink.js"(exports, module2) { |
| "use strict"; |
| var u = require_universalify().fromPromise; |
| var path6 = (0, import_chunk_QGM4M3NI.__require)("path"); |
| var fs4 = require_fs(); |
| var { mkdirs, mkdirsSync } = require_mkdirs(); |
| var { symlinkPaths, symlinkPathsSync } = require_symlink_paths(); |
| var { symlinkType, symlinkTypeSync } = require_symlink_type(); |
| var { pathExists: pathExists2 } = require_path_exists(); |
| var { areIdentical } = require_stat(); |
| async function createSymlink(srcpath, dstpath, type) { |
| let stats; |
| try { |
| stats = await fs4.lstat(dstpath); |
| } catch { |
| } |
| if (stats && stats.isSymbolicLink()) { |
| const [srcStat, dstStat] = await Promise.all([ |
| fs4.stat(srcpath), |
| fs4.stat(dstpath) |
| ]); |
| if (areIdentical(srcStat, dstStat)) return; |
| } |
| const relative = await symlinkPaths(srcpath, dstpath); |
| srcpath = relative.toDst; |
| const toType = await symlinkType(relative.toCwd, type); |
| const dir = path6.dirname(dstpath); |
| if (!await pathExists2(dir)) { |
| await mkdirs(dir); |
| } |
| return fs4.symlink(srcpath, dstpath, toType); |
| } |
| function createSymlinkSync(srcpath, dstpath, type) { |
| let stats; |
| try { |
| stats = fs4.lstatSync(dstpath); |
| } catch { |
| } |
| if (stats && stats.isSymbolicLink()) { |
| const srcStat = fs4.statSync(srcpath); |
| const dstStat = fs4.statSync(dstpath); |
| if (areIdentical(srcStat, dstStat)) return; |
| } |
| const relative = symlinkPathsSync(srcpath, dstpath); |
| srcpath = relative.toDst; |
| type = symlinkTypeSync(relative.toCwd, type); |
| const dir = path6.dirname(dstpath); |
| const exists = fs4.existsSync(dir); |
| if (exists) return fs4.symlinkSync(srcpath, dstpath, type); |
| mkdirsSync(dir); |
| return fs4.symlinkSync(srcpath, dstpath, type); |
| } |
| module2.exports = { |
| createSymlink: u(createSymlink), |
| createSymlinkSync |
| }; |
| } |
| }); |
| var require_ensure = (0, import_chunk_QGM4M3NI.__commonJS)({ |
| "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/ensure/index.js"(exports, module2) { |
| "use strict"; |
| var { createFile, createFileSync } = require_file(); |
| var { createLink, createLinkSync } = require_link(); |
| var { createSymlink, createSymlinkSync } = require_symlink(); |
| module2.exports = { |
| |
| createFile, |
| createFileSync, |
| ensureFile: createFile, |
| ensureFileSync: createFileSync, |
| |
| createLink, |
| createLinkSync, |
| ensureLink: createLink, |
| ensureLinkSync: createLinkSync, |
| |
| createSymlink, |
| createSymlinkSync, |
| ensureSymlink: createSymlink, |
| ensureSymlinkSync: createSymlinkSync |
| }; |
| } |
| }); |
| var require_utils2 = (0, import_chunk_QGM4M3NI.__commonJS)({ |
| "../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/utils.js"(exports, module2) { |
| "use strict"; |
| function stringify(obj, { EOL = "\n", finalEOL = true, replacer = null, spaces } = {}) { |
| const EOF = finalEOL ? EOL : ""; |
| const str = JSON.stringify(obj, replacer, spaces); |
| return str.replace(/\n/g, EOL) + EOF; |
| } |
| function stripBom(content) { |
| if (Buffer.isBuffer(content)) content = content.toString("utf8"); |
| return content.replace(/^\uFEFF/, ""); |
| } |
| module2.exports = { stringify, stripBom }; |
| } |
| }); |
| var require_jsonfile = (0, import_chunk_QGM4M3NI.__commonJS)({ |
| "../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/index.js"(exports, module2) { |
| "use strict"; |
| var _fs; |
| try { |
| _fs = require_graceful_fs(); |
| } catch (_) { |
| _fs = (0, import_chunk_QGM4M3NI.__require)("fs"); |
| } |
| var universalify = require_universalify(); |
| var { stringify, stripBom } = require_utils2(); |
| async function _readFile(file, options = {}) { |
| if (typeof options === "string") { |
| options = { encoding: options }; |
| } |
| const fs4 = options.fs || _fs; |
| const shouldThrow = "throws" in options ? options.throws : true; |
| let data = await universalify.fromCallback(fs4.readFile)(file, options); |
| data = stripBom(data); |
| let obj; |
| try { |
| obj = JSON.parse(data, options ? options.reviver : null); |
| } catch (err) { |
| if (shouldThrow) { |
| err.message = `${file}: ${err.message}`; |
| throw err; |
| } else { |
| return null; |
| } |
| } |
| return obj; |
| } |
| var readFile = universalify.fromPromise(_readFile); |
| function readFileSync(file, options = {}) { |
| if (typeof options === "string") { |
| options = { encoding: options }; |
| } |
| const fs4 = options.fs || _fs; |
| const shouldThrow = "throws" in options ? options.throws : true; |
| try { |
| let content = fs4.readFileSync(file, options); |
| content = stripBom(content); |
| return JSON.parse(content, options.reviver); |
| } catch (err) { |
| if (shouldThrow) { |
| err.message = `${file}: ${err.message}`; |
| throw err; |
| } else { |
| return null; |
| } |
| } |
| } |
| async function _writeFile(file, obj, options = {}) { |
| const fs4 = options.fs || _fs; |
| const str = stringify(obj, options); |
| await universalify.fromCallback(fs4.writeFile)(file, str, options); |
| } |
| var writeFile = universalify.fromPromise(_writeFile); |
| function writeFileSync(file, obj, options = {}) { |
| const fs4 = options.fs || _fs; |
| const str = stringify(obj, options); |
| return fs4.writeFileSync(file, str, options); |
| } |
| var jsonfile = { |
| readFile, |
| readFileSync, |
| writeFile, |
| writeFileSync |
| }; |
| module2.exports = jsonfile; |
| } |
| }); |
| var require_jsonfile2 = (0, import_chunk_QGM4M3NI.__commonJS)({ |
| "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/json/jsonfile.js"(exports, module2) { |
| "use strict"; |
| var jsonFile = require_jsonfile(); |
| module2.exports = { |
| |
| readJson: jsonFile.readFile, |
| readJsonSync: jsonFile.readFileSync, |
| writeJson: jsonFile.writeFile, |
| writeJsonSync: jsonFile.writeFileSync |
| }; |
| } |
| }); |
| var require_output_file = (0, import_chunk_QGM4M3NI.__commonJS)({ |
| "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/output-file/index.js"(exports, module2) { |
| "use strict"; |
| var u = require_universalify().fromPromise; |
| var fs4 = require_fs(); |
| var path6 = (0, import_chunk_QGM4M3NI.__require)("path"); |
| var mkdir = require_mkdirs(); |
| var pathExists2 = require_path_exists().pathExists; |
| async function outputFile(file, data, encoding = "utf-8") { |
| const dir = path6.dirname(file); |
| if (!await pathExists2(dir)) { |
| await mkdir.mkdirs(dir); |
| } |
| return fs4.writeFile(file, data, encoding); |
| } |
| function outputFileSync(file, ...args) { |
| const dir = path6.dirname(file); |
| if (!fs4.existsSync(dir)) { |
| mkdir.mkdirsSync(dir); |
| } |
| fs4.writeFileSync(file, ...args); |
| } |
| module2.exports = { |
| outputFile: u(outputFile), |
| outputFileSync |
| }; |
| } |
| }); |
| var require_output_json = (0, import_chunk_QGM4M3NI.__commonJS)({ |
| "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/json/output-json.js"(exports, module2) { |
| "use strict"; |
| var { stringify } = require_utils2(); |
| var { outputFile } = require_output_file(); |
| async function outputJson(file, data, options = {}) { |
| const str = stringify(data, options); |
| await outputFile(file, str, options); |
| } |
| module2.exports = outputJson; |
| } |
| }); |
| var require_output_json_sync = (0, import_chunk_QGM4M3NI.__commonJS)({ |
| "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/json/output-json-sync.js"(exports, module2) { |
| "use strict"; |
| var { stringify } = require_utils2(); |
| var { outputFileSync } = require_output_file(); |
| function outputJsonSync(file, data, options) { |
| const str = stringify(data, options); |
| outputFileSync(file, str, options); |
| } |
| module2.exports = outputJsonSync; |
| } |
| }); |
| var require_json = (0, import_chunk_QGM4M3NI.__commonJS)({ |
| "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/json/index.js"(exports, module2) { |
| "use strict"; |
| var u = require_universalify().fromPromise; |
| var jsonFile = require_jsonfile2(); |
| jsonFile.outputJson = u(require_output_json()); |
| jsonFile.outputJsonSync = require_output_json_sync(); |
| jsonFile.outputJSON = jsonFile.outputJson; |
| jsonFile.outputJSONSync = jsonFile.outputJsonSync; |
| jsonFile.writeJSON = jsonFile.writeJson; |
| jsonFile.writeJSONSync = jsonFile.writeJsonSync; |
| jsonFile.readJSON = jsonFile.readJson; |
| jsonFile.readJSONSync = jsonFile.readJsonSync; |
| module2.exports = jsonFile; |
| } |
| }); |
| var require_move = (0, import_chunk_QGM4M3NI.__commonJS)({ |
| "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/move/move.js"(exports, module2) { |
| "use strict"; |
| var fs4 = require_fs(); |
| var path6 = (0, import_chunk_QGM4M3NI.__require)("path"); |
| var { copy } = require_copy2(); |
| var { remove } = require_remove(); |
| var { mkdirp } = require_mkdirs(); |
| var { pathExists: pathExists2 } = require_path_exists(); |
| var stat = require_stat(); |
| async function move(src, dest, opts = {}) { |
| const overwrite = opts.overwrite || opts.clobber || false; |
| const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, "move", opts); |
| await stat.checkParentPaths(src, srcStat, dest, "move"); |
| const destParent = path6.dirname(dest); |
| const parsedParentPath = path6.parse(destParent); |
| if (parsedParentPath.root !== destParent) { |
| await mkdirp(destParent); |
| } |
| return doRename(src, dest, overwrite, isChangingCase); |
| } |
| async function doRename(src, dest, overwrite, isChangingCase) { |
| if (!isChangingCase) { |
| if (overwrite) { |
| await remove(dest); |
| } else if (await pathExists2(dest)) { |
| throw new Error("dest already exists."); |
| } |
| } |
| try { |
| await fs4.rename(src, dest); |
| } catch (err) { |
| if (err.code !== "EXDEV") { |
| throw err; |
| } |
| await moveAcrossDevice(src, dest, overwrite); |
| } |
| } |
| async function moveAcrossDevice(src, dest, overwrite) { |
| const opts = { |
| overwrite, |
| errorOnExist: true, |
| preserveTimestamps: true |
| }; |
| await copy(src, dest, opts); |
| return remove(src); |
| } |
| module2.exports = move; |
| } |
| }); |
| var require_move_sync = (0, import_chunk_QGM4M3NI.__commonJS)({ |
| "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/move/move-sync.js"(exports, module2) { |
| "use strict"; |
| var fs4 = require_graceful_fs(); |
| var path6 = (0, import_chunk_QGM4M3NI.__require)("path"); |
| var copySync = require_copy2().copySync; |
| var removeSync = require_remove().removeSync; |
| var mkdirpSync = require_mkdirs().mkdirpSync; |
| var stat = require_stat(); |
| function moveSync(src, dest, opts) { |
| opts = opts || {}; |
| const overwrite = opts.overwrite || opts.clobber || false; |
| const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, "move", opts); |
| stat.checkParentPathsSync(src, srcStat, dest, "move"); |
| if (!isParentRoot(dest)) mkdirpSync(path6.dirname(dest)); |
| return doRename(src, dest, overwrite, isChangingCase); |
| } |
| function isParentRoot(dest) { |
| const parent = path6.dirname(dest); |
| const parsedPath = path6.parse(parent); |
| return parsedPath.root === parent; |
| } |
| function doRename(src, dest, overwrite, isChangingCase) { |
| if (isChangingCase) return rename(src, dest, overwrite); |
| if (overwrite) { |
| removeSync(dest); |
| return rename(src, dest, overwrite); |
| } |
| if (fs4.existsSync(dest)) throw new Error("dest already exists."); |
| return rename(src, dest, overwrite); |
| } |
| function rename(src, dest, overwrite) { |
| try { |
| fs4.renameSync(src, dest); |
| } catch (err) { |
| if (err.code !== "EXDEV") throw err; |
| return moveAcrossDevice(src, dest, overwrite); |
| } |
| } |
| function moveAcrossDevice(src, dest, overwrite) { |
| const opts = { |
| overwrite, |
| errorOnExist: true, |
| preserveTimestamps: true |
| }; |
| copySync(src, dest, opts); |
| return removeSync(src); |
| } |
| module2.exports = moveSync; |
| } |
| }); |
| var require_move2 = (0, import_chunk_QGM4M3NI.__commonJS)({ |
| "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/move/index.js"(exports, module2) { |
| "use strict"; |
| var u = require_universalify().fromPromise; |
| module2.exports = { |
| move: u(require_move()), |
| moveSync: require_move_sync() |
| }; |
| } |
| }); |
| var require_lib = (0, import_chunk_QGM4M3NI.__commonJS)({ |
| "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/index.js"(exports, module2) { |
| "use strict"; |
| module2.exports = { |
| |
| ...require_fs(), |
| |
| ...require_copy2(), |
| ...require_empty(), |
| ...require_ensure(), |
| ...require_json(), |
| ...require_mkdirs(), |
| ...require_move2(), |
| ...require_output_file(), |
| ...require_path_exists(), |
| ...require_remove() |
| }; |
| } |
| }); |
| var import_common_path_prefix = (0, import_chunk_QGM4M3NI.__toESM)(require_common_path_prefix(), 1); |
| var typeMappings = { |
| directory: "isDirectory", |
| file: "isFile" |
| }; |
| function checkType(type) { |
| if (Object.hasOwnProperty.call(typeMappings, type)) { |
| return; |
| } |
| throw new Error(`Invalid type specified: ${type}`); |
| } |
| var matchType = (type, stat) => stat[typeMappings[type]](); |
| var toPath = (urlOrPath) => urlOrPath instanceof URL ? (0, import_node_url2.fileURLToPath)(urlOrPath) : urlOrPath; |
| function locatePathSync(paths, { |
| cwd: cwd2 = import_node_process2.default.cwd(), |
| type = "file", |
| allowSymlinks = true |
| } = {}) { |
| checkType(type); |
| cwd2 = toPath(cwd2); |
| const statFunction = allowSymlinks ? import_node_fs3.default.statSync : import_node_fs3.default.lstatSync; |
| for (const path_ of paths) { |
| try { |
| const stat = statFunction(import_node_path5.default.resolve(cwd2, path_), { |
| throwIfNoEntry: false |
| }); |
| if (!stat) { |
| continue; |
| } |
| if (matchType(type, stat)) { |
| return path_; |
| } |
| } catch { |
| } |
| } |
| } |
| var toPath2 = (urlOrPath) => urlOrPath instanceof URL ? (0, import_node_url.fileURLToPath)(urlOrPath) : urlOrPath; |
| var findUpStop = Symbol("findUpStop"); |
| function findUpMultipleSync(name, options = {}) { |
| let directory = import_node_path4.default.resolve(toPath2(options.cwd) || ""); |
| const { root } = import_node_path4.default.parse(directory); |
| const stopAt = options.stopAt || root; |
| const limit = options.limit || Number.POSITIVE_INFINITY; |
| const paths = [name].flat(); |
| const runMatcher = (locateOptions) => { |
| if (typeof name !== "function") { |
| return locatePathSync(paths, locateOptions); |
| } |
| const foundPath = name(locateOptions.cwd); |
| if (typeof foundPath === "string") { |
| return locatePathSync([foundPath], locateOptions); |
| } |
| return foundPath; |
| }; |
| const matches = []; |
| while (true) { |
| const foundPath = runMatcher({ ...options, cwd: directory }); |
| if (foundPath === findUpStop) { |
| break; |
| } |
| if (foundPath) { |
| matches.push(import_node_path4.default.resolve(directory, foundPath)); |
| } |
| if (directory === stopAt || matches.length >= limit) { |
| break; |
| } |
| directory = import_node_path4.default.dirname(directory); |
| } |
| return matches; |
| } |
| function findUpSync(name, options = {}) { |
| const matches = findUpMultipleSync(name, { ...options, limit: 1 }); |
| return matches[0]; |
| } |
| function packageDirectorySync({ cwd: cwd2 } = {}) { |
| const filePath = findUpSync("package.json", { cwd: cwd2 }); |
| return filePath && import_node_path3.default.dirname(filePath); |
| } |
| var { env, cwd } = import_node_process.default; |
| var isWritable = (path6) => { |
| try { |
| import_node_fs2.default.accessSync(path6, import_node_fs2.default.constants.W_OK); |
| return true; |
| } catch { |
| return false; |
| } |
| }; |
| function useDirectory(directory, options) { |
| if (options.create) { |
| import_node_fs2.default.mkdirSync(directory, { recursive: true }); |
| } |
| return directory; |
| } |
| function getNodeModuleDirectory(directory) { |
| const nodeModules = import_node_path2.default.join(directory, "node_modules"); |
| if (!isWritable(nodeModules) && (import_node_fs2.default.existsSync(nodeModules) || !isWritable(import_node_path2.default.join(directory)))) { |
| return; |
| } |
| return nodeModules; |
| } |
| function findCacheDirectory(options = {}) { |
| if (env.CACHE_DIR && !["true", "false", "1", "0"].includes(env.CACHE_DIR)) { |
| return useDirectory(import_node_path2.default.join(env.CACHE_DIR, options.name), options); |
| } |
| let { cwd: directory = cwd(), files } = options; |
| if (files) { |
| if (!Array.isArray(files)) { |
| throw new TypeError(`Expected \`files\` option to be an array, got \`${typeof files}\`.`); |
| } |
| directory = (0, import_common_path_prefix.default)(files.map((file) => import_node_path2.default.resolve(directory, file))); |
| } |
| directory = packageDirectorySync({ cwd: directory }); |
| if (!directory) { |
| return; |
| } |
| const nodeModules = getNodeModuleDirectory(directory); |
| if (!nodeModules) { |
| return; |
| } |
| return useDirectory(import_node_path2.default.join(directory, "node_modules", ".cache", options.name), options); |
| } |
| var import_fs_extra = (0, import_chunk_QGM4M3NI.__toESM)(require_lib()); |
| var debug = (0, import_debug.default)("prisma:fetch-engine:cache-dir"); |
| async function getRootCacheDir() { |
| if (import_node_os.default.platform() === "win32") { |
| const cacheDir = findCacheDirectory({ name: "prisma", create: true }); |
| if (cacheDir) { |
| return cacheDir; |
| } |
| if (process.env.APPDATA) { |
| return import_node_path.default.join(process.env.APPDATA, "Prisma"); |
| } |
| } |
| if (process.env.AWS_LAMBDA_FUNCTION_VERSION) { |
| try { |
| await (0, import_fs_extra.ensureDir)(`/tmp/prisma-download`); |
| return `/tmp/prisma-download`; |
| } catch (e) { |
| return null; |
| } |
| } |
| return process.env.XDG_CACHE_HOME ? import_node_path.default.join(process.env.XDG_CACHE_HOME, "prisma") : import_node_path.default.join(import_node_os.default.homedir(), ".cache/prisma"); |
| } |
| async function getCacheDir(channel, version, binaryTarget) { |
| const rootCacheDir = await getRootCacheDir(); |
| if (!rootCacheDir) { |
| return null; |
| } |
| const cacheDir = import_node_path.default.join(rootCacheDir, channel, version, binaryTarget); |
| try { |
| if (!import_node_fs.default.existsSync(cacheDir)) { |
| await (0, import_fs_extra.ensureDir)(cacheDir); |
| } |
| } catch (e) { |
| debug("The following error is being caught and just there for debugging:"); |
| debug(e); |
| return null; |
| } |
| return cacheDir; |
| } |
| function getDownloadUrl({ |
| channel, |
| version, |
| binaryTarget, |
| binaryName, |
| extension = ".gz" |
| }) { |
| const baseUrl = process.env.PRISMA_BINARIES_MIRROR || |
| process.env.PRISMA_ENGINES_MIRROR || "https://binaries.prisma.sh"; |
| const finalExtension = ( |
| |
| binaryTarget === "windows" && "libquery-engine" !== binaryName ? `.exe${extension}` : extension |
| ); |
| if (binaryName === "libquery-engine") { |
| binaryName = (0, import_get_platform.getNodeAPIName)(binaryTarget, "url"); |
| } |
| return `${baseUrl}/${channel}/${version}/${binaryTarget}/${binaryName}${finalExtension}`; |
| } |
| async function overwriteFile(sourcePath, targetPath) { |
| if (import_node_os.default.platform() === "darwin") { |
| await removeFileIfExists(targetPath); |
| await import_node_fs.default.promises.copyFile(sourcePath, targetPath); |
| } else { |
| const tempPath = `${targetPath}.tmp${process.pid}`; |
| await import_node_fs.default.promises.copyFile(sourcePath, tempPath); |
| await import_node_fs.default.promises.rename(tempPath, targetPath); |
| } |
| } |
| async function removeFileIfExists(filePath) { |
| try { |
| await import_node_fs.default.promises.unlink(filePath); |
| } catch (e) { |
| if (e.code !== "ENOENT") { |
| throw e; |
| } |
| } |
| } |
|
|