@prisma/fetch-engine 6.5.0-integration-fix-improve-global-omit-api-performance-2.1 → 6.5.0-integration-feat-prisma-config-without-new-package.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.
- package/dist/{chunk-G7EM4XDM.js → chunk-HACCWU3B.js} +423 -1304
- package/dist/{chunk-FKKOTNO6.js → chunk-I3P4GT6A.js} +5 -5
- package/dist/{chunk-4EZ7ALS2.js → chunk-ORVVLJ4G.js} +778 -6
- package/dist/{chunk-B7GZJEJB.js → chunk-XCJ4KRBS.js} +23 -23
- package/dist/{chunk-Y6JXVPQ2.js → chunk-Z4FI34ZU.js} +22 -22
- package/dist/cleanupCache.js +3 -3
- package/dist/download.js +10 -10
- package/dist/downloadZip.js +3 -3
- package/dist/index.js +12 -12
- package/dist/utils.js +5 -5
- package/package.json +6 -6
@@ -26,16 +26,15 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
26
26
|
mod
|
27
27
|
));
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
29
|
-
var
|
30
|
-
__export(
|
29
|
+
var chunk_HACCWU3B_exports = {};
|
30
|
+
__export(chunk_HACCWU3B_exports, {
|
31
31
|
getCacheDir: () => getCacheDir,
|
32
32
|
getDownloadUrl: () => getDownloadUrl,
|
33
33
|
getRootCacheDir: () => getRootCacheDir,
|
34
34
|
overwriteFile: () => overwriteFile,
|
35
|
-
require_graceful_fs: () => require_graceful_fs,
|
36
35
|
require_lib: () => require_lib
|
37
36
|
});
|
38
|
-
module.exports = __toCommonJS(
|
37
|
+
module.exports = __toCommonJS(chunk_HACCWU3B_exports);
|
39
38
|
var import_chunk_AH6QHEOA = require("./chunk-AH6QHEOA.js");
|
40
39
|
var import_debug = __toESM(require("@prisma/debug"));
|
41
40
|
var import_get_platform = require("@prisma/get-platform");
|
@@ -83,18 +82,15 @@ var require_common_path_prefix = (0, import_chunk_AH6QHEOA.__commonJS)({
|
|
83
82
|
}
|
84
83
|
});
|
85
84
|
var require_universalify = (0, import_chunk_AH6QHEOA.__commonJS)({
|
86
|
-
"../../node_modules/.pnpm/universalify@2.0.
|
85
|
+
"../../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js"(exports) {
|
87
86
|
"use strict";
|
88
87
|
exports.fromCallback = function(fn) {
|
89
88
|
return Object.defineProperty(function(...args) {
|
90
89
|
if (typeof args[args.length - 1] === "function") fn.apply(this, args);
|
91
90
|
else {
|
92
91
|
return new Promise((resolve, reject) => {
|
93
|
-
|
94
|
-
|
95
|
-
...args,
|
96
|
-
(err, res) => err != null ? reject(err) : resolve(res)
|
97
|
-
);
|
92
|
+
args.push((err, res) => err != null ? reject(err) : resolve(res));
|
93
|
+
fn.apply(this, args);
|
98
94
|
});
|
99
95
|
}
|
100
96
|
}, "name", { value: fn.name });
|
@@ -103,13 +99,16 @@ var require_universalify = (0, import_chunk_AH6QHEOA.__commonJS)({
|
|
103
99
|
return Object.defineProperty(function(...args) {
|
104
100
|
const cb = args[args.length - 1];
|
105
101
|
if (typeof cb !== "function") return fn.apply(this, args);
|
106
|
-
else
|
102
|
+
else {
|
103
|
+
args.pop();
|
104
|
+
fn.apply(this, args).then((r) => cb(null, r), cb);
|
105
|
+
}
|
107
106
|
}, "name", { value: fn.name });
|
108
107
|
};
|
109
108
|
}
|
110
109
|
});
|
111
110
|
var require_polyfills = (0, import_chunk_AH6QHEOA.__commonJS)({
|
112
|
-
"../../node_modules/.pnpm/graceful-fs@4.2.
|
111
|
+
"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js"(exports, module2) {
|
113
112
|
"use strict";
|
114
113
|
var constants = (0, import_chunk_AH6QHEOA.__require)("constants");
|
115
114
|
var origCwd = process.cwd;
|
@@ -179,7 +178,7 @@ var require_polyfills = (0, import_chunk_AH6QHEOA.__commonJS)({
|
|
179
178
|
var start = Date.now();
|
180
179
|
var backoff = 0;
|
181
180
|
fs$rename(from, to, function CB(er) {
|
182
|
-
if (er && (er.code === "EACCES" || er.code === "EPERM") && Date.now() - start < 6e4) {
|
181
|
+
if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
|
183
182
|
setTimeout(function() {
|
184
183
|
fs4.stat(to, function(stater, st) {
|
185
184
|
if (stater && stater.code === "ENOENT")
|
@@ -396,7 +395,7 @@ var require_polyfills = (0, import_chunk_AH6QHEOA.__commonJS)({
|
|
396
395
|
}
|
397
396
|
});
|
398
397
|
var require_legacy_streams = (0, import_chunk_AH6QHEOA.__commonJS)({
|
399
|
-
"../../node_modules/.pnpm/graceful-fs@4.2.
|
398
|
+
"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js"(exports, module2) {
|
400
399
|
"use strict";
|
401
400
|
var Stream = (0, import_chunk_AH6QHEOA.__require)("stream").Stream;
|
402
401
|
module2.exports = legacy;
|
@@ -491,7 +490,7 @@ var require_legacy_streams = (0, import_chunk_AH6QHEOA.__commonJS)({
|
|
491
490
|
}
|
492
491
|
});
|
493
492
|
var require_clone = (0, import_chunk_AH6QHEOA.__commonJS)({
|
494
|
-
"../../node_modules/.pnpm/graceful-fs@4.2.
|
493
|
+
"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/clone.js"(exports, module2) {
|
495
494
|
"use strict";
|
496
495
|
module2.exports = clone;
|
497
496
|
var getPrototypeOf = Object.getPrototypeOf || function(obj) {
|
@@ -512,7 +511,7 @@ var require_clone = (0, import_chunk_AH6QHEOA.__commonJS)({
|
|
512
511
|
}
|
513
512
|
});
|
514
513
|
var require_graceful_fs = (0, import_chunk_AH6QHEOA.__commonJS)({
|
515
|
-
"../../node_modules/.pnpm/graceful-fs@4.2.
|
514
|
+
"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js"(exports, module2) {
|
516
515
|
"use strict";
|
517
516
|
var fs4 = (0, import_chunk_AH6QHEOA.__require)("fs");
|
518
517
|
var polyfills = require_polyfills();
|
@@ -881,7 +880,7 @@ var require_graceful_fs = (0, import_chunk_AH6QHEOA.__commonJS)({
|
|
881
880
|
}
|
882
881
|
});
|
883
882
|
var require_fs = (0, import_chunk_AH6QHEOA.__commonJS)({
|
884
|
-
"../../node_modules/.pnpm/fs-extra@11.
|
883
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/fs/index.js"(exports) {
|
885
884
|
"use strict";
|
886
885
|
var u = require_universalify().fromCallback;
|
887
886
|
var fs4 = require_graceful_fs();
|
@@ -892,6 +891,7 @@ var require_fs = (0, import_chunk_AH6QHEOA.__commonJS)({
|
|
892
891
|
"chown",
|
893
892
|
"close",
|
894
893
|
"copyFile",
|
894
|
+
"cp",
|
895
895
|
"fchmod",
|
896
896
|
"fchown",
|
897
897
|
"fdatasync",
|
@@ -899,8 +899,10 @@ var require_fs = (0, import_chunk_AH6QHEOA.__commonJS)({
|
|
899
899
|
"fsync",
|
900
900
|
"ftruncate",
|
901
901
|
"futimes",
|
902
|
+
"glob",
|
902
903
|
"lchmod",
|
903
904
|
"lchown",
|
905
|
+
"lutimes",
|
904
906
|
"link",
|
905
907
|
"lstat",
|
906
908
|
"mkdir",
|
@@ -915,6 +917,7 @@ var require_fs = (0, import_chunk_AH6QHEOA.__commonJS)({
|
|
915
917
|
"rm",
|
916
918
|
"rmdir",
|
917
919
|
"stat",
|
920
|
+
"statfs",
|
918
921
|
"symlink",
|
919
922
|
"truncate",
|
920
923
|
"unlink",
|
@@ -991,7 +994,7 @@ var require_fs = (0, import_chunk_AH6QHEOA.__commonJS)({
|
|
991
994
|
}
|
992
995
|
});
|
993
996
|
var require_utils = (0, import_chunk_AH6QHEOA.__commonJS)({
|
994
|
-
"../../node_modules/.pnpm/fs-extra@11.
|
997
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/mkdirs/utils.js"(exports, module2) {
|
995
998
|
"use strict";
|
996
999
|
var path6 = (0, import_chunk_AH6QHEOA.__require)("path");
|
997
1000
|
module2.exports.checkPath = function checkPath(pth) {
|
@@ -1007,7 +1010,7 @@ var require_utils = (0, import_chunk_AH6QHEOA.__commonJS)({
|
|
1007
1010
|
}
|
1008
1011
|
});
|
1009
1012
|
var require_make_dir = (0, import_chunk_AH6QHEOA.__commonJS)({
|
1010
|
-
"../../node_modules/.pnpm/fs-extra@11.
|
1013
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports, module2) {
|
1011
1014
|
"use strict";
|
1012
1015
|
var fs4 = require_fs();
|
1013
1016
|
var { checkPath } = require_utils();
|
@@ -1033,7 +1036,7 @@ var require_make_dir = (0, import_chunk_AH6QHEOA.__commonJS)({
|
|
1033
1036
|
}
|
1034
1037
|
});
|
1035
1038
|
var require_mkdirs = (0, import_chunk_AH6QHEOA.__commonJS)({
|
1036
|
-
"../../node_modules/.pnpm/fs-extra@11.
|
1039
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/mkdirs/index.js"(exports, module2) {
|
1037
1040
|
"use strict";
|
1038
1041
|
var u = require_universalify().fromPromise;
|
1039
1042
|
var { makeDir: _makeDir, makeDirSync } = require_make_dir();
|
@@ -1050,7 +1053,7 @@ var require_mkdirs = (0, import_chunk_AH6QHEOA.__commonJS)({
|
|
1050
1053
|
}
|
1051
1054
|
});
|
1052
1055
|
var require_path_exists = (0, import_chunk_AH6QHEOA.__commonJS)({
|
1053
|
-
"../../node_modules/.pnpm/fs-extra@11.
|
1056
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/path-exists/index.js"(exports, module2) {
|
1054
1057
|
"use strict";
|
1055
1058
|
var u = require_universalify().fromPromise;
|
1056
1059
|
var fs4 = require_fs();
|
@@ -1064,18 +1067,25 @@ var require_path_exists = (0, import_chunk_AH6QHEOA.__commonJS)({
|
|
1064
1067
|
}
|
1065
1068
|
});
|
1066
1069
|
var require_utimes = (0, import_chunk_AH6QHEOA.__commonJS)({
|
1067
|
-
"../../node_modules/.pnpm/fs-extra@11.
|
1070
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/util/utimes.js"(exports, module2) {
|
1068
1071
|
"use strict";
|
1069
|
-
var fs4 =
|
1070
|
-
|
1071
|
-
|
1072
|
-
|
1073
|
-
|
1074
|
-
|
1075
|
-
|
1076
|
-
|
1077
|
-
|
1078
|
-
|
1072
|
+
var fs4 = require_fs();
|
1073
|
+
var u = require_universalify().fromPromise;
|
1074
|
+
async function utimesMillis(path6, atime, mtime) {
|
1075
|
+
const fd = await fs4.open(path6, "r+");
|
1076
|
+
let closeErr = null;
|
1077
|
+
try {
|
1078
|
+
await fs4.futimes(fd, atime, mtime);
|
1079
|
+
} finally {
|
1080
|
+
try {
|
1081
|
+
await fs4.close(fd);
|
1082
|
+
} catch (e) {
|
1083
|
+
closeErr = e;
|
1084
|
+
}
|
1085
|
+
}
|
1086
|
+
if (closeErr) {
|
1087
|
+
throw closeErr;
|
1088
|
+
}
|
1079
1089
|
}
|
1080
1090
|
function utimesMillisSync(path6, atime, mtime) {
|
1081
1091
|
const fd = fs4.openSync(path6, "r+");
|
@@ -1083,17 +1093,17 @@ var require_utimes = (0, import_chunk_AH6QHEOA.__commonJS)({
|
|
1083
1093
|
return fs4.closeSync(fd);
|
1084
1094
|
}
|
1085
1095
|
module2.exports = {
|
1086
|
-
utimesMillis,
|
1096
|
+
utimesMillis: u(utimesMillis),
|
1087
1097
|
utimesMillisSync
|
1088
1098
|
};
|
1089
1099
|
}
|
1090
1100
|
});
|
1091
1101
|
var require_stat = (0, import_chunk_AH6QHEOA.__commonJS)({
|
1092
|
-
"../../node_modules/.pnpm/fs-extra@11.
|
1102
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/util/stat.js"(exports, module2) {
|
1093
1103
|
"use strict";
|
1094
1104
|
var fs4 = require_fs();
|
1095
1105
|
var path6 = (0, import_chunk_AH6QHEOA.__require)("path");
|
1096
|
-
var
|
1106
|
+
var u = require_universalify().fromPromise;
|
1097
1107
|
function getStats(src, dest, opts) {
|
1098
1108
|
const statFunc = opts.dereference ? (file) => fs4.stat(file, { bigint: true }) : (file) => fs4.lstat(file, { bigint: true });
|
1099
1109
|
return Promise.all([
|
@@ -1116,31 +1126,28 @@ var require_stat = (0, import_chunk_AH6QHEOA.__commonJS)({
|
|
1116
1126
|
}
|
1117
1127
|
return { srcStat, destStat };
|
1118
1128
|
}
|
1119
|
-
function checkPaths(src, dest, funcName, opts
|
1120
|
-
|
1121
|
-
|
1122
|
-
|
1123
|
-
|
1124
|
-
|
1125
|
-
|
1126
|
-
|
1127
|
-
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
1128
|
-
return cb(null, { srcStat, destStat, isChangingCase: true });
|
1129
|
-
}
|
1130
|
-
return cb(new Error("Source and destination must not be the same."));
|
1131
|
-
}
|
1132
|
-
if (srcStat.isDirectory() && !destStat.isDirectory()) {
|
1133
|
-
return cb(new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`));
|
1134
|
-
}
|
1135
|
-
if (!srcStat.isDirectory() && destStat.isDirectory()) {
|
1136
|
-
return cb(new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`));
|
1129
|
+
async function checkPaths(src, dest, funcName, opts) {
|
1130
|
+
const { srcStat, destStat } = await getStats(src, dest, opts);
|
1131
|
+
if (destStat) {
|
1132
|
+
if (areIdentical(srcStat, destStat)) {
|
1133
|
+
const srcBaseName = path6.basename(src);
|
1134
|
+
const destBaseName = path6.basename(dest);
|
1135
|
+
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
1136
|
+
return { srcStat, destStat, isChangingCase: true };
|
1137
1137
|
}
|
1138
|
+
throw new Error("Source and destination must not be the same.");
|
1139
|
+
}
|
1140
|
+
if (srcStat.isDirectory() && !destStat.isDirectory()) {
|
1141
|
+
throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`);
|
1138
1142
|
}
|
1139
|
-
if (srcStat.isDirectory() &&
|
1140
|
-
|
1143
|
+
if (!srcStat.isDirectory() && destStat.isDirectory()) {
|
1144
|
+
throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`);
|
1141
1145
|
}
|
1142
|
-
|
1143
|
-
|
1146
|
+
}
|
1147
|
+
if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
|
1148
|
+
throw new Error(errMsg(src, dest, funcName));
|
1149
|
+
}
|
1150
|
+
return { srcStat, destStat };
|
1144
1151
|
}
|
1145
1152
|
function checkPathsSync(src, dest, funcName, opts) {
|
1146
1153
|
const { srcStat, destStat } = getStatsSync(src, dest, opts);
|
@@ -1165,20 +1172,21 @@ var require_stat = (0, import_chunk_AH6QHEOA.__commonJS)({
|
|
1165
1172
|
}
|
1166
1173
|
return { srcStat, destStat };
|
1167
1174
|
}
|
1168
|
-
function checkParentPaths(src, srcStat, dest, funcName
|
1175
|
+
async function checkParentPaths(src, srcStat, dest, funcName) {
|
1169
1176
|
const srcParent = path6.resolve(path6.dirname(src));
|
1170
1177
|
const destParent = path6.resolve(path6.dirname(dest));
|
1171
|
-
if (destParent === srcParent || destParent === path6.parse(destParent).root) return
|
1172
|
-
|
1173
|
-
|
1174
|
-
|
1175
|
-
|
1176
|
-
|
1177
|
-
|
1178
|
-
|
1179
|
-
|
1180
|
-
|
1181
|
-
}
|
1178
|
+
if (destParent === srcParent || destParent === path6.parse(destParent).root) return;
|
1179
|
+
let destStat;
|
1180
|
+
try {
|
1181
|
+
destStat = await fs4.stat(destParent, { bigint: true });
|
1182
|
+
} catch (err) {
|
1183
|
+
if (err.code === "ENOENT") return;
|
1184
|
+
throw err;
|
1185
|
+
}
|
1186
|
+
if (areIdentical(srcStat, destStat)) {
|
1187
|
+
throw new Error(errMsg(src, dest, funcName));
|
1188
|
+
}
|
1189
|
+
return checkParentPaths(src, srcStat, destParent, funcName);
|
1182
1190
|
}
|
1183
1191
|
function checkParentPathsSync(src, srcStat, dest, funcName) {
|
1184
1192
|
const srcParent = path6.resolve(path6.dirname(src));
|
@@ -1202,40 +1210,37 @@ var require_stat = (0, import_chunk_AH6QHEOA.__commonJS)({
|
|
1202
1210
|
function isSrcSubdir(src, dest) {
|
1203
1211
|
const srcArr = path6.resolve(src).split(path6.sep).filter((i) => i);
|
1204
1212
|
const destArr = path6.resolve(dest).split(path6.sep).filter((i) => i);
|
1205
|
-
return srcArr.
|
1213
|
+
return srcArr.every((cur, i) => destArr[i] === cur);
|
1206
1214
|
}
|
1207
1215
|
function errMsg(src, dest, funcName) {
|
1208
1216
|
return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`;
|
1209
1217
|
}
|
1210
1218
|
module2.exports = {
|
1211
|
-
checkPaths
|
1219
|
+
// checkPaths
|
1220
|
+
checkPaths: u(checkPaths),
|
1212
1221
|
checkPathsSync,
|
1213
|
-
|
1222
|
+
// checkParent
|
1223
|
+
checkParentPaths: u(checkParentPaths),
|
1214
1224
|
checkParentPathsSync,
|
1225
|
+
// Misc
|
1215
1226
|
isSrcSubdir,
|
1216
1227
|
areIdentical
|
1217
1228
|
};
|
1218
1229
|
}
|
1219
1230
|
});
|
1220
1231
|
var require_copy = (0, import_chunk_AH6QHEOA.__commonJS)({
|
1221
|
-
"../../node_modules/.pnpm/fs-extra@11.
|
1232
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/copy/copy.js"(exports, module2) {
|
1222
1233
|
"use strict";
|
1223
|
-
var fs4 =
|
1234
|
+
var fs4 = require_fs();
|
1224
1235
|
var path6 = (0, import_chunk_AH6QHEOA.__require)("path");
|
1225
|
-
var mkdirs = require_mkdirs()
|
1226
|
-
var pathExists2 = require_path_exists()
|
1227
|
-
var utimesMillis = require_utimes()
|
1236
|
+
var { mkdirs } = require_mkdirs();
|
1237
|
+
var { pathExists: pathExists2 } = require_path_exists();
|
1238
|
+
var { utimesMillis } = require_utimes();
|
1228
1239
|
var stat = require_stat();
|
1229
|
-
function copy(src, dest, opts
|
1230
|
-
if (typeof opts === "function"
|
1231
|
-
cb = opts;
|
1232
|
-
opts = {};
|
1233
|
-
} else if (typeof opts === "function") {
|
1240
|
+
async function copy(src, dest, opts = {}) {
|
1241
|
+
if (typeof opts === "function") {
|
1234
1242
|
opts = { filter: opts };
|
1235
1243
|
}
|
1236
|
-
cb = cb || function() {
|
1237
|
-
};
|
1238
|
-
opts = opts || {};
|
1239
1244
|
opts.clobber = "clobber" in opts ? !!opts.clobber : true;
|
1240
1245
|
opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber;
|
1241
1246
|
if (opts.preserveTimestamps && process.arch === "ia32") {
|
@@ -1245,176 +1250,113 @@ var require_copy = (0, import_chunk_AH6QHEOA.__commonJS)({
|
|
1245
1250
|
"fs-extra-WARN0001"
|
1246
1251
|
);
|
1247
1252
|
}
|
1248
|
-
stat.checkPaths(src, dest, "copy", opts
|
1249
|
-
|
1250
|
-
|
1251
|
-
|
1252
|
-
if (err2) return cb(err2);
|
1253
|
-
runFilter(src, dest, opts, (err3, include) => {
|
1254
|
-
if (err3) return cb(err3);
|
1255
|
-
if (!include) return cb();
|
1256
|
-
checkParentDir(destStat, src, dest, opts, cb);
|
1257
|
-
});
|
1258
|
-
});
|
1259
|
-
});
|
1260
|
-
}
|
1261
|
-
function checkParentDir(destStat, src, dest, opts, cb) {
|
1253
|
+
const { srcStat, destStat } = await stat.checkPaths(src, dest, "copy", opts);
|
1254
|
+
await stat.checkParentPaths(src, srcStat, dest, "copy");
|
1255
|
+
const include = await runFilter(src, dest, opts);
|
1256
|
+
if (!include) return;
|
1262
1257
|
const destParent = path6.dirname(dest);
|
1263
|
-
pathExists2(destParent
|
1264
|
-
|
1265
|
-
|
1266
|
-
|
1267
|
-
|
1268
|
-
return getStats(destStat, src, dest, opts, cb);
|
1269
|
-
});
|
1270
|
-
});
|
1258
|
+
const dirExists = await pathExists2(destParent);
|
1259
|
+
if (!dirExists) {
|
1260
|
+
await mkdirs(destParent);
|
1261
|
+
}
|
1262
|
+
await getStatsAndPerformCopy(destStat, src, dest, opts);
|
1271
1263
|
}
|
1272
|
-
function runFilter(src, dest, opts
|
1273
|
-
if (!opts.filter) return
|
1274
|
-
|
1275
|
-
}
|
1276
|
-
function getStats(destStat, src, dest, opts, cb) {
|
1277
|
-
const stat2 = opts.dereference ? fs4.stat : fs4.lstat;
|
1278
|
-
stat2(src, (err, srcStat) => {
|
1279
|
-
if (err) return cb(err);
|
1280
|
-
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts, cb);
|
1281
|
-
else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts, cb);
|
1282
|
-
else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts, cb);
|
1283
|
-
else if (srcStat.isSocket()) return cb(new Error(`Cannot copy a socket file: ${src}`));
|
1284
|
-
else if (srcStat.isFIFO()) return cb(new Error(`Cannot copy a FIFO pipe: ${src}`));
|
1285
|
-
return cb(new Error(`Unknown file: ${src}`));
|
1286
|
-
});
|
1264
|
+
async function runFilter(src, dest, opts) {
|
1265
|
+
if (!opts.filter) return true;
|
1266
|
+
return opts.filter(src, dest);
|
1287
1267
|
}
|
1288
|
-
function
|
1289
|
-
|
1290
|
-
|
1268
|
+
async function getStatsAndPerformCopy(destStat, src, dest, opts) {
|
1269
|
+
const statFn = opts.dereference ? fs4.stat : fs4.lstat;
|
1270
|
+
const srcStat = await statFn(src);
|
1271
|
+
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
|
1272
|
+
if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
|
1273
|
+
if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts);
|
1274
|
+
if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`);
|
1275
|
+
if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`);
|
1276
|
+
throw new Error(`Unknown file: ${src}`);
|
1291
1277
|
}
|
1292
|
-
function
|
1278
|
+
async function onFile(srcStat, destStat, src, dest, opts) {
|
1279
|
+
if (!destStat) return copyFile(srcStat, src, dest, opts);
|
1293
1280
|
if (opts.overwrite) {
|
1294
|
-
fs4.unlink(dest
|
1295
|
-
|
1296
|
-
|
1297
|
-
|
1298
|
-
|
1299
|
-
|
1300
|
-
} else return cb();
|
1301
|
-
}
|
1302
|
-
function copyFile(srcStat, src, dest, opts, cb) {
|
1303
|
-
fs4.copyFile(src, dest, (err) => {
|
1304
|
-
if (err) return cb(err);
|
1305
|
-
if (opts.preserveTimestamps) return handleTimestampsAndMode(srcStat.mode, src, dest, cb);
|
1306
|
-
return setDestMode(dest, srcStat.mode, cb);
|
1307
|
-
});
|
1281
|
+
await fs4.unlink(dest);
|
1282
|
+
return copyFile(srcStat, src, dest, opts);
|
1283
|
+
}
|
1284
|
+
if (opts.errorOnExist) {
|
1285
|
+
throw new Error(`'${dest}' already exists`);
|
1286
|
+
}
|
1308
1287
|
}
|
1309
|
-
function
|
1310
|
-
|
1311
|
-
|
1312
|
-
|
1313
|
-
|
1314
|
-
}
|
1288
|
+
async function copyFile(srcStat, src, dest, opts) {
|
1289
|
+
await fs4.copyFile(src, dest);
|
1290
|
+
if (opts.preserveTimestamps) {
|
1291
|
+
if (fileIsNotWritable(srcStat.mode)) {
|
1292
|
+
await makeFileWritable(dest, srcStat.mode);
|
1293
|
+
}
|
1294
|
+
const updatedSrcStat = await fs4.stat(src);
|
1295
|
+
await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
|
1315
1296
|
}
|
1316
|
-
return
|
1297
|
+
return fs4.chmod(dest, srcStat.mode);
|
1317
1298
|
}
|
1318
1299
|
function fileIsNotWritable(srcMode) {
|
1319
1300
|
return (srcMode & 128) === 0;
|
1320
1301
|
}
|
1321
|
-
function makeFileWritable(dest, srcMode
|
1322
|
-
return
|
1323
|
-
}
|
1324
|
-
function setDestTimestampsAndMode(srcMode, src, dest, cb) {
|
1325
|
-
setDestTimestamps(src, dest, (err) => {
|
1326
|
-
if (err) return cb(err);
|
1327
|
-
return setDestMode(dest, srcMode, cb);
|
1328
|
-
});
|
1329
|
-
}
|
1330
|
-
function setDestMode(dest, srcMode, cb) {
|
1331
|
-
return fs4.chmod(dest, srcMode, cb);
|
1332
|
-
}
|
1333
|
-
function setDestTimestamps(src, dest, cb) {
|
1334
|
-
fs4.stat(src, (err, updatedSrcStat) => {
|
1335
|
-
if (err) return cb(err);
|
1336
|
-
return utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime, cb);
|
1337
|
-
});
|
1338
|
-
}
|
1339
|
-
function onDir(srcStat, destStat, src, dest, opts, cb) {
|
1340
|
-
if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts, cb);
|
1341
|
-
return copyDir(src, dest, opts, cb);
|
1342
|
-
}
|
1343
|
-
function mkDirAndCopy(srcMode, src, dest, opts, cb) {
|
1344
|
-
fs4.mkdir(dest, (err) => {
|
1345
|
-
if (err) return cb(err);
|
1346
|
-
copyDir(src, dest, opts, (err2) => {
|
1347
|
-
if (err2) return cb(err2);
|
1348
|
-
return setDestMode(dest, srcMode, cb);
|
1349
|
-
});
|
1350
|
-
});
|
1351
|
-
}
|
1352
|
-
function copyDir(src, dest, opts, cb) {
|
1353
|
-
fs4.readdir(src, (err, items) => {
|
1354
|
-
if (err) return cb(err);
|
1355
|
-
return copyDirItems(items, src, dest, opts, cb);
|
1356
|
-
});
|
1357
|
-
}
|
1358
|
-
function copyDirItems(items, src, dest, opts, cb) {
|
1359
|
-
const item = items.pop();
|
1360
|
-
if (!item) return cb();
|
1361
|
-
return copyDirItem(items, item, src, dest, opts, cb);
|
1362
|
-
}
|
1363
|
-
function copyDirItem(items, item, src, dest, opts, cb) {
|
1364
|
-
const srcItem = path6.join(src, item);
|
1365
|
-
const destItem = path6.join(dest, item);
|
1366
|
-
runFilter(srcItem, destItem, opts, (err, include) => {
|
1367
|
-
if (err) return cb(err);
|
1368
|
-
if (!include) return copyDirItems(items, src, dest, opts, cb);
|
1369
|
-
stat.checkPaths(srcItem, destItem, "copy", opts, (err2, stats) => {
|
1370
|
-
if (err2) return cb(err2);
|
1371
|
-
const { destStat } = stats;
|
1372
|
-
getStats(destStat, srcItem, destItem, opts, (err3) => {
|
1373
|
-
if (err3) return cb(err3);
|
1374
|
-
return copyDirItems(items, src, dest, opts, cb);
|
1375
|
-
});
|
1376
|
-
});
|
1377
|
-
});
|
1302
|
+
function makeFileWritable(dest, srcMode) {
|
1303
|
+
return fs4.chmod(dest, srcMode | 128);
|
1378
1304
|
}
|
1379
|
-
function
|
1380
|
-
|
1381
|
-
|
1382
|
-
|
1383
|
-
|
1384
|
-
|
1385
|
-
|
1386
|
-
|
1387
|
-
|
1388
|
-
|
1389
|
-
if (
|
1390
|
-
|
1391
|
-
|
1392
|
-
|
1393
|
-
if (opts.dereference) {
|
1394
|
-
resolvedDest = path6.resolve(process.cwd(), resolvedDest);
|
1395
|
-
}
|
1396
|
-
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
1397
|
-
return cb(new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`));
|
1398
|
-
}
|
1399
|
-
if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
|
1400
|
-
return cb(new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`));
|
1305
|
+
async function onDir(srcStat, destStat, src, dest, opts) {
|
1306
|
+
if (!destStat) {
|
1307
|
+
await fs4.mkdir(dest);
|
1308
|
+
}
|
1309
|
+
const promises = [];
|
1310
|
+
for await (const item of await fs4.opendir(src)) {
|
1311
|
+
const srcItem = path6.join(src, item.name);
|
1312
|
+
const destItem = path6.join(dest, item.name);
|
1313
|
+
promises.push(
|
1314
|
+
runFilter(srcItem, destItem, opts).then((include) => {
|
1315
|
+
if (include) {
|
1316
|
+
return stat.checkPaths(srcItem, destItem, "copy", opts).then(({ destStat: destStat2 }) => {
|
1317
|
+
return getStatsAndPerformCopy(destStat2, srcItem, destItem, opts);
|
1318
|
+
});
|
1401
1319
|
}
|
1402
|
-
|
1403
|
-
|
1404
|
-
|
1405
|
-
|
1320
|
+
})
|
1321
|
+
);
|
1322
|
+
}
|
1323
|
+
await Promise.all(promises);
|
1324
|
+
if (!destStat) {
|
1325
|
+
await fs4.chmod(dest, srcStat.mode);
|
1326
|
+
}
|
1406
1327
|
}
|
1407
|
-
function
|
1408
|
-
fs4.
|
1409
|
-
|
1410
|
-
|
1411
|
-
}
|
1328
|
+
async function onLink(destStat, src, dest, opts) {
|
1329
|
+
let resolvedSrc = await fs4.readlink(src);
|
1330
|
+
if (opts.dereference) {
|
1331
|
+
resolvedSrc = path6.resolve(process.cwd(), resolvedSrc);
|
1332
|
+
}
|
1333
|
+
if (!destStat) {
|
1334
|
+
return fs4.symlink(resolvedSrc, dest);
|
1335
|
+
}
|
1336
|
+
let resolvedDest = null;
|
1337
|
+
try {
|
1338
|
+
resolvedDest = await fs4.readlink(dest);
|
1339
|
+
} catch (e) {
|
1340
|
+
if (e.code === "EINVAL" || e.code === "UNKNOWN") return fs4.symlink(resolvedSrc, dest);
|
1341
|
+
throw e;
|
1342
|
+
}
|
1343
|
+
if (opts.dereference) {
|
1344
|
+
resolvedDest = path6.resolve(process.cwd(), resolvedDest);
|
1345
|
+
}
|
1346
|
+
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
1347
|
+
throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
|
1348
|
+
}
|
1349
|
+
if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
|
1350
|
+
throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
|
1351
|
+
}
|
1352
|
+
await fs4.unlink(dest);
|
1353
|
+
return fs4.symlink(resolvedSrc, dest);
|
1412
1354
|
}
|
1413
1355
|
module2.exports = copy;
|
1414
1356
|
}
|
1415
1357
|
});
|
1416
1358
|
var require_copy_sync = (0, import_chunk_AH6QHEOA.__commonJS)({
|
1417
|
-
"../../node_modules/.pnpm/fs-extra@11.
|
1359
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/copy/copy-sync.js"(exports, module2) {
|
1418
1360
|
"use strict";
|
1419
1361
|
var fs4 = require_graceful_fs();
|
1420
1362
|
var path6 = (0, import_chunk_AH6QHEOA.__require)("path");
|
@@ -1496,7 +1438,15 @@ var require_copy_sync = (0, import_chunk_AH6QHEOA.__commonJS)({
|
|
1496
1438
|
return setDestMode(dest, srcMode);
|
1497
1439
|
}
|
1498
1440
|
function copyDir(src, dest, opts) {
|
1499
|
-
fs4.
|
1441
|
+
const dir = fs4.opendirSync(src);
|
1442
|
+
try {
|
1443
|
+
let dirent;
|
1444
|
+
while ((dirent = dir.readSync()) !== null) {
|
1445
|
+
copyDirItem(dirent.name, src, dest, opts);
|
1446
|
+
}
|
1447
|
+
} finally {
|
1448
|
+
dir.closeSync();
|
1449
|
+
}
|
1500
1450
|
}
|
1501
1451
|
function copyDirItem(item, src, dest, opts) {
|
1502
1452
|
const srcItem = path6.join(src, item);
|
@@ -1540,9 +1490,9 @@ var require_copy_sync = (0, import_chunk_AH6QHEOA.__commonJS)({
|
|
1540
1490
|
}
|
1541
1491
|
});
|
1542
1492
|
var require_copy2 = (0, import_chunk_AH6QHEOA.__commonJS)({
|
1543
|
-
"../../node_modules/.pnpm/fs-extra@11.
|
1493
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/copy/index.js"(exports, module2) {
|
1544
1494
|
"use strict";
|
1545
|
-
var u = require_universalify().
|
1495
|
+
var u = require_universalify().fromPromise;
|
1546
1496
|
module2.exports = {
|
1547
1497
|
copy: u(require_copy()),
|
1548
1498
|
copySync: require_copy_sync()
|
@@ -1550,7 +1500,7 @@ var require_copy2 = (0, import_chunk_AH6QHEOA.__commonJS)({
|
|
1550
1500
|
}
|
1551
1501
|
});
|
1552
1502
|
var require_remove = (0, import_chunk_AH6QHEOA.__commonJS)({
|
1553
|
-
"../../node_modules/.pnpm/fs-extra@11.
|
1503
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/remove/index.js"(exports, module2) {
|
1554
1504
|
"use strict";
|
1555
1505
|
var fs4 = require_graceful_fs();
|
1556
1506
|
var u = require_universalify().fromCallback;
|
@@ -1567,7 +1517,7 @@ var require_remove = (0, import_chunk_AH6QHEOA.__commonJS)({
|
|
1567
1517
|
}
|
1568
1518
|
});
|
1569
1519
|
var require_empty = (0, import_chunk_AH6QHEOA.__commonJS)({
|
1570
|
-
"../../node_modules/.pnpm/fs-extra@11.
|
1520
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/empty/index.js"(exports, module2) {
|
1571
1521
|
"use strict";
|
1572
1522
|
var u = require_universalify().fromPromise;
|
1573
1523
|
var fs4 = require_fs();
|
@@ -1604,40 +1554,37 @@ var require_empty = (0, import_chunk_AH6QHEOA.__commonJS)({
|
|
1604
1554
|
}
|
1605
1555
|
});
|
1606
1556
|
var require_file = (0, import_chunk_AH6QHEOA.__commonJS)({
|
1607
|
-
"../../node_modules/.pnpm/fs-extra@11.
|
1557
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/ensure/file.js"(exports, module2) {
|
1608
1558
|
"use strict";
|
1609
|
-
var u = require_universalify().
|
1559
|
+
var u = require_universalify().fromPromise;
|
1610
1560
|
var path6 = (0, import_chunk_AH6QHEOA.__require)("path");
|
1611
|
-
var fs4 =
|
1561
|
+
var fs4 = require_fs();
|
1612
1562
|
var mkdir = require_mkdirs();
|
1613
|
-
function createFile(file
|
1614
|
-
|
1615
|
-
|
1616
|
-
|
1617
|
-
|
1618
|
-
|
1563
|
+
async function createFile(file) {
|
1564
|
+
let stats;
|
1565
|
+
try {
|
1566
|
+
stats = await fs4.stat(file);
|
1567
|
+
} catch {
|
1568
|
+
}
|
1569
|
+
if (stats && stats.isFile()) return;
|
1570
|
+
const dir = path6.dirname(file);
|
1571
|
+
let dirStats = null;
|
1572
|
+
try {
|
1573
|
+
dirStats = await fs4.stat(dir);
|
1574
|
+
} catch (err) {
|
1575
|
+
if (err.code === "ENOENT") {
|
1576
|
+
await mkdir.mkdirs(dir);
|
1577
|
+
await fs4.writeFile(file, "");
|
1578
|
+
return;
|
1579
|
+
} else {
|
1580
|
+
throw err;
|
1581
|
+
}
|
1582
|
+
}
|
1583
|
+
if (dirStats.isDirectory()) {
|
1584
|
+
await fs4.writeFile(file, "");
|
1585
|
+
} else {
|
1586
|
+
await fs4.readdir(dir);
|
1619
1587
|
}
|
1620
|
-
fs4.stat(file, (err, stats) => {
|
1621
|
-
if (!err && stats.isFile()) return callback();
|
1622
|
-
const dir = path6.dirname(file);
|
1623
|
-
fs4.stat(dir, (err2, stats2) => {
|
1624
|
-
if (err2) {
|
1625
|
-
if (err2.code === "ENOENT") {
|
1626
|
-
return mkdir.mkdirs(dir, (err3) => {
|
1627
|
-
if (err3) return callback(err3);
|
1628
|
-
makeFile();
|
1629
|
-
});
|
1630
|
-
}
|
1631
|
-
return callback(err2);
|
1632
|
-
}
|
1633
|
-
if (stats2.isDirectory()) makeFile();
|
1634
|
-
else {
|
1635
|
-
fs4.readdir(dir, (err3) => {
|
1636
|
-
if (err3) return callback(err3);
|
1637
|
-
});
|
1638
|
-
}
|
1639
|
-
});
|
1640
|
-
});
|
1641
1588
|
}
|
1642
1589
|
function createFileSync(file) {
|
1643
1590
|
let stats;
|
@@ -1664,39 +1611,34 @@ var require_file = (0, import_chunk_AH6QHEOA.__commonJS)({
|
|
1664
1611
|
}
|
1665
1612
|
});
|
1666
1613
|
var require_link = (0, import_chunk_AH6QHEOA.__commonJS)({
|
1667
|
-
"../../node_modules/.pnpm/fs-extra@11.
|
1614
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/ensure/link.js"(exports, module2) {
|
1668
1615
|
"use strict";
|
1669
|
-
var u = require_universalify().
|
1616
|
+
var u = require_universalify().fromPromise;
|
1670
1617
|
var path6 = (0, import_chunk_AH6QHEOA.__require)("path");
|
1671
|
-
var fs4 =
|
1618
|
+
var fs4 = require_fs();
|
1672
1619
|
var mkdir = require_mkdirs();
|
1673
|
-
var pathExists2 = require_path_exists()
|
1620
|
+
var { pathExists: pathExists2 } = require_path_exists();
|
1674
1621
|
var { areIdentical } = require_stat();
|
1675
|
-
function createLink(srcpath, dstpath
|
1676
|
-
|
1677
|
-
|
1678
|
-
|
1679
|
-
|
1680
|
-
});
|
1622
|
+
async function createLink(srcpath, dstpath) {
|
1623
|
+
let dstStat;
|
1624
|
+
try {
|
1625
|
+
dstStat = await fs4.lstat(dstpath);
|
1626
|
+
} catch {
|
1681
1627
|
}
|
1682
|
-
|
1683
|
-
|
1684
|
-
|
1685
|
-
|
1686
|
-
|
1687
|
-
|
1688
|
-
|
1689
|
-
|
1690
|
-
|
1691
|
-
|
1692
|
-
|
1693
|
-
|
1694
|
-
|
1695
|
-
|
1696
|
-
});
|
1697
|
-
});
|
1698
|
-
});
|
1699
|
-
});
|
1628
|
+
let srcStat;
|
1629
|
+
try {
|
1630
|
+
srcStat = await fs4.lstat(srcpath);
|
1631
|
+
} catch (err) {
|
1632
|
+
err.message = err.message.replace("lstat", "ensureLink");
|
1633
|
+
throw err;
|
1634
|
+
}
|
1635
|
+
if (dstStat && areIdentical(srcStat, dstStat)) return;
|
1636
|
+
const dir = path6.dirname(dstpath);
|
1637
|
+
const dirExists = await pathExists2(dir);
|
1638
|
+
if (!dirExists) {
|
1639
|
+
await mkdir.mkdirs(dir);
|
1640
|
+
}
|
1641
|
+
await fs4.link(srcpath, dstpath);
|
1700
1642
|
}
|
1701
1643
|
function createLinkSync(srcpath, dstpath) {
|
1702
1644
|
let dstStat;
|
@@ -1724,99 +1666,94 @@ var require_link = (0, import_chunk_AH6QHEOA.__commonJS)({
|
|
1724
1666
|
}
|
1725
1667
|
});
|
1726
1668
|
var require_symlink_paths = (0, import_chunk_AH6QHEOA.__commonJS)({
|
1727
|
-
"../../node_modules/.pnpm/fs-extra@11.
|
1669
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports, module2) {
|
1728
1670
|
"use strict";
|
1729
1671
|
var path6 = (0, import_chunk_AH6QHEOA.__require)("path");
|
1730
|
-
var fs4 =
|
1731
|
-
var pathExists2 = require_path_exists()
|
1732
|
-
|
1672
|
+
var fs4 = require_fs();
|
1673
|
+
var { pathExists: pathExists2 } = require_path_exists();
|
1674
|
+
var u = require_universalify().fromPromise;
|
1675
|
+
async function symlinkPaths(srcpath, dstpath) {
|
1733
1676
|
if (path6.isAbsolute(srcpath)) {
|
1734
|
-
|
1735
|
-
|
1736
|
-
|
1737
|
-
|
1738
|
-
|
1739
|
-
|
1740
|
-
|
1741
|
-
|
1742
|
-
|
1743
|
-
}
|
1744
|
-
}
|
1745
|
-
|
1746
|
-
|
1747
|
-
|
1748
|
-
|
1749
|
-
|
1750
|
-
|
1751
|
-
|
1752
|
-
|
1753
|
-
});
|
1754
|
-
} else {
|
1755
|
-
return fs4.lstat(srcpath, (err2) => {
|
1756
|
-
if (err2) {
|
1757
|
-
err2.message = err2.message.replace("lstat", "ensureSymlink");
|
1758
|
-
return callback(err2);
|
1759
|
-
}
|
1760
|
-
return callback(null, {
|
1761
|
-
toCwd: srcpath,
|
1762
|
-
toDst: path6.relative(dstdir, srcpath)
|
1763
|
-
});
|
1764
|
-
});
|
1765
|
-
}
|
1766
|
-
});
|
1677
|
+
try {
|
1678
|
+
await fs4.lstat(srcpath);
|
1679
|
+
} catch (err) {
|
1680
|
+
err.message = err.message.replace("lstat", "ensureSymlink");
|
1681
|
+
throw err;
|
1682
|
+
}
|
1683
|
+
return {
|
1684
|
+
toCwd: srcpath,
|
1685
|
+
toDst: srcpath
|
1686
|
+
};
|
1687
|
+
}
|
1688
|
+
const dstdir = path6.dirname(dstpath);
|
1689
|
+
const relativeToDst = path6.join(dstdir, srcpath);
|
1690
|
+
const exists = await pathExists2(relativeToDst);
|
1691
|
+
if (exists) {
|
1692
|
+
return {
|
1693
|
+
toCwd: relativeToDst,
|
1694
|
+
toDst: srcpath
|
1695
|
+
};
|
1767
1696
|
}
|
1697
|
+
try {
|
1698
|
+
await fs4.lstat(srcpath);
|
1699
|
+
} catch (err) {
|
1700
|
+
err.message = err.message.replace("lstat", "ensureSymlink");
|
1701
|
+
throw err;
|
1702
|
+
}
|
1703
|
+
return {
|
1704
|
+
toCwd: srcpath,
|
1705
|
+
toDst: path6.relative(dstdir, srcpath)
|
1706
|
+
};
|
1768
1707
|
}
|
1769
1708
|
function symlinkPathsSync(srcpath, dstpath) {
|
1770
|
-
let exists;
|
1771
1709
|
if (path6.isAbsolute(srcpath)) {
|
1772
|
-
|
1773
|
-
if (!
|
1710
|
+
const exists2 = fs4.existsSync(srcpath);
|
1711
|
+
if (!exists2) throw new Error("absolute srcpath does not exist");
|
1774
1712
|
return {
|
1775
1713
|
toCwd: srcpath,
|
1776
1714
|
toDst: srcpath
|
1777
1715
|
};
|
1778
|
-
} else {
|
1779
|
-
const dstdir = path6.dirname(dstpath);
|
1780
|
-
const relativeToDst = path6.join(dstdir, srcpath);
|
1781
|
-
exists = fs4.existsSync(relativeToDst);
|
1782
|
-
if (exists) {
|
1783
|
-
return {
|
1784
|
-
toCwd: relativeToDst,
|
1785
|
-
toDst: srcpath
|
1786
|
-
};
|
1787
|
-
} else {
|
1788
|
-
exists = fs4.existsSync(srcpath);
|
1789
|
-
if (!exists) throw new Error("relative srcpath does not exist");
|
1790
|
-
return {
|
1791
|
-
toCwd: srcpath,
|
1792
|
-
toDst: path6.relative(dstdir, srcpath)
|
1793
|
-
};
|
1794
|
-
}
|
1795
1716
|
}
|
1717
|
+
const dstdir = path6.dirname(dstpath);
|
1718
|
+
const relativeToDst = path6.join(dstdir, srcpath);
|
1719
|
+
const exists = fs4.existsSync(relativeToDst);
|
1720
|
+
if (exists) {
|
1721
|
+
return {
|
1722
|
+
toCwd: relativeToDst,
|
1723
|
+
toDst: srcpath
|
1724
|
+
};
|
1725
|
+
}
|
1726
|
+
const srcExists = fs4.existsSync(srcpath);
|
1727
|
+
if (!srcExists) throw new Error("relative srcpath does not exist");
|
1728
|
+
return {
|
1729
|
+
toCwd: srcpath,
|
1730
|
+
toDst: path6.relative(dstdir, srcpath)
|
1731
|
+
};
|
1796
1732
|
}
|
1797
1733
|
module2.exports = {
|
1798
|
-
symlinkPaths,
|
1734
|
+
symlinkPaths: u(symlinkPaths),
|
1799
1735
|
symlinkPathsSync
|
1800
1736
|
};
|
1801
1737
|
}
|
1802
1738
|
});
|
1803
1739
|
var require_symlink_type = (0, import_chunk_AH6QHEOA.__commonJS)({
|
1804
|
-
"../../node_modules/.pnpm/fs-extra@11.
|
1740
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/ensure/symlink-type.js"(exports, module2) {
|
1805
1741
|
"use strict";
|
1806
|
-
var fs4 =
|
1807
|
-
|
1808
|
-
|
1809
|
-
|
1810
|
-
|
1811
|
-
|
1812
|
-
|
1813
|
-
|
1814
|
-
|
1815
|
-
}
|
1742
|
+
var fs4 = require_fs();
|
1743
|
+
var u = require_universalify().fromPromise;
|
1744
|
+
async function symlinkType(srcpath, type) {
|
1745
|
+
if (type) return type;
|
1746
|
+
let stats;
|
1747
|
+
try {
|
1748
|
+
stats = await fs4.lstat(srcpath);
|
1749
|
+
} catch {
|
1750
|
+
return "file";
|
1751
|
+
}
|
1752
|
+
return stats && stats.isDirectory() ? "dir" : "file";
|
1816
1753
|
}
|
1817
1754
|
function symlinkTypeSync(srcpath, type) {
|
1818
|
-
let stats;
|
1819
1755
|
if (type) return type;
|
1756
|
+
let stats;
|
1820
1757
|
try {
|
1821
1758
|
stats = fs4.lstatSync(srcpath);
|
1822
1759
|
} catch {
|
@@ -1825,882 +1762,93 @@ var require_symlink_type = (0, import_chunk_AH6QHEOA.__commonJS)({
|
|
1825
1762
|
return stats && stats.isDirectory() ? "dir" : "file";
|
1826
1763
|
}
|
1827
1764
|
module2.exports = {
|
1828
|
-
symlinkType,
|
1765
|
+
symlinkType: u(symlinkType),
|
1829
1766
|
symlinkTypeSync
|
1830
1767
|
};
|
1831
1768
|
}
|
1832
1769
|
});
|
1833
1770
|
var require_symlink = (0, import_chunk_AH6QHEOA.__commonJS)({
|
1834
|
-
"../../node_modules/.pnpm/fs-extra@11.
|
1771
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/ensure/symlink.js"(exports, module2) {
|
1835
1772
|
"use strict";
|
1836
|
-
var u = require_universalify().
|
1773
|
+
var u = require_universalify().fromPromise;
|
1837
1774
|
var path6 = (0, import_chunk_AH6QHEOA.__require)("path");
|
1838
1775
|
var fs4 = require_fs();
|
1839
|
-
var
|
1840
|
-
var
|
1841
|
-
var
|
1842
|
-
var
|
1843
|
-
var symlinkPaths = _symlinkPaths.symlinkPaths;
|
1844
|
-
var symlinkPathsSync = _symlinkPaths.symlinkPathsSync;
|
1845
|
-
var _symlinkType = require_symlink_type();
|
1846
|
-
var symlinkType = _symlinkType.symlinkType;
|
1847
|
-
var symlinkTypeSync = _symlinkType.symlinkTypeSync;
|
1848
|
-
var pathExists2 = require_path_exists().pathExists;
|
1776
|
+
var { mkdirs, mkdirsSync } = require_mkdirs();
|
1777
|
+
var { symlinkPaths, symlinkPathsSync } = require_symlink_paths();
|
1778
|
+
var { symlinkType, symlinkTypeSync } = require_symlink_type();
|
1779
|
+
var { pathExists: pathExists2 } = require_path_exists();
|
1849
1780
|
var { areIdentical } = require_stat();
|
1850
|
-
function createSymlink(srcpath, dstpath, type
|
1851
|
-
callback = typeof type === "function" ? type : callback;
|
1852
|
-
type = typeof type === "function" ? false : type;
|
1853
|
-
fs4.lstat(dstpath, (err, stats) => {
|
1854
|
-
if (!err && stats.isSymbolicLink()) {
|
1855
|
-
Promise.all([
|
1856
|
-
fs4.stat(srcpath),
|
1857
|
-
fs4.stat(dstpath)
|
1858
|
-
]).then(([srcStat, dstStat]) => {
|
1859
|
-
if (areIdentical(srcStat, dstStat)) return callback(null);
|
1860
|
-
_createSymlink(srcpath, dstpath, type, callback);
|
1861
|
-
});
|
1862
|
-
} else _createSymlink(srcpath, dstpath, type, callback);
|
1863
|
-
});
|
1864
|
-
}
|
1865
|
-
function _createSymlink(srcpath, dstpath, type, callback) {
|
1866
|
-
symlinkPaths(srcpath, dstpath, (err, relative) => {
|
1867
|
-
if (err) return callback(err);
|
1868
|
-
srcpath = relative.toDst;
|
1869
|
-
symlinkType(relative.toCwd, type, (err2, type2) => {
|
1870
|
-
if (err2) return callback(err2);
|
1871
|
-
const dir = path6.dirname(dstpath);
|
1872
|
-
pathExists2(dir, (err3, dirExists) => {
|
1873
|
-
if (err3) return callback(err3);
|
1874
|
-
if (dirExists) return fs4.symlink(srcpath, dstpath, type2, callback);
|
1875
|
-
mkdirs(dir, (err4) => {
|
1876
|
-
if (err4) return callback(err4);
|
1877
|
-
fs4.symlink(srcpath, dstpath, type2, callback);
|
1878
|
-
});
|
1879
|
-
});
|
1880
|
-
});
|
1881
|
-
});
|
1882
|
-
}
|
1883
|
-
function createSymlinkSync(srcpath, dstpath, type) {
|
1781
|
+
async function createSymlink(srcpath, dstpath, type) {
|
1884
1782
|
let stats;
|
1885
1783
|
try {
|
1886
|
-
stats = fs4.
|
1784
|
+
stats = await fs4.lstat(dstpath);
|
1887
1785
|
} catch {
|
1888
1786
|
}
|
1889
1787
|
if (stats && stats.isSymbolicLink()) {
|
1890
|
-
const srcStat =
|
1891
|
-
|
1788
|
+
const [srcStat, dstStat] = await Promise.all([
|
1789
|
+
fs4.stat(srcpath),
|
1790
|
+
fs4.stat(dstpath)
|
1791
|
+
]);
|
1892
1792
|
if (areIdentical(srcStat, dstStat)) return;
|
1893
1793
|
}
|
1894
|
-
const relative =
|
1794
|
+
const relative = await symlinkPaths(srcpath, dstpath);
|
1895
1795
|
srcpath = relative.toDst;
|
1896
|
-
|
1796
|
+
const toType = await symlinkType(relative.toCwd, type);
|
1897
1797
|
const dir = path6.dirname(dstpath);
|
1898
|
-
|
1899
|
-
|
1900
|
-
mkdirsSync(dir);
|
1901
|
-
return fs4.symlinkSync(srcpath, dstpath, type);
|
1902
|
-
}
|
1903
|
-
module2.exports = {
|
1904
|
-
createSymlink: u(createSymlink),
|
1905
|
-
createSymlinkSync
|
1906
|
-
};
|
1907
|
-
}
|
1908
|
-
});
|
1909
|
-
var require_ensure = (0, import_chunk_AH6QHEOA.__commonJS)({
|
1910
|
-
"../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/index.js"(exports, module2) {
|
1911
|
-
"use strict";
|
1912
|
-
var { createFile, createFileSync } = require_file();
|
1913
|
-
var { createLink, createLinkSync } = require_link();
|
1914
|
-
var { createSymlink, createSymlinkSync } = require_symlink();
|
1915
|
-
module2.exports = {
|
1916
|
-
// file
|
1917
|
-
createFile,
|
1918
|
-
createFileSync,
|
1919
|
-
ensureFile: createFile,
|
1920
|
-
ensureFileSync: createFileSync,
|
1921
|
-
// link
|
1922
|
-
createLink,
|
1923
|
-
createLinkSync,
|
1924
|
-
ensureLink: createLink,
|
1925
|
-
ensureLinkSync: createLinkSync,
|
1926
|
-
// symlink
|
1927
|
-
createSymlink,
|
1928
|
-
createSymlinkSync,
|
1929
|
-
ensureSymlink: createSymlink,
|
1930
|
-
ensureSymlinkSync: createSymlinkSync
|
1931
|
-
};
|
1932
|
-
}
|
1933
|
-
});
|
1934
|
-
var require_polyfills2 = (0, import_chunk_AH6QHEOA.__commonJS)({
|
1935
|
-
"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js"(exports, module2) {
|
1936
|
-
"use strict";
|
1937
|
-
var constants = (0, import_chunk_AH6QHEOA.__require)("constants");
|
1938
|
-
var origCwd = process.cwd;
|
1939
|
-
var cwd2 = null;
|
1940
|
-
var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform;
|
1941
|
-
process.cwd = function() {
|
1942
|
-
if (!cwd2)
|
1943
|
-
cwd2 = origCwd.call(process);
|
1944
|
-
return cwd2;
|
1945
|
-
};
|
1946
|
-
try {
|
1947
|
-
process.cwd();
|
1948
|
-
} catch (er) {
|
1949
|
-
}
|
1950
|
-
if (typeof process.chdir === "function") {
|
1951
|
-
chdir = process.chdir;
|
1952
|
-
process.chdir = function(d) {
|
1953
|
-
cwd2 = null;
|
1954
|
-
chdir.call(process, d);
|
1955
|
-
};
|
1956
|
-
if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir);
|
1957
|
-
}
|
1958
|
-
var chdir;
|
1959
|
-
module2.exports = patch;
|
1960
|
-
function patch(fs4) {
|
1961
|
-
if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
|
1962
|
-
patchLchmod(fs4);
|
1963
|
-
}
|
1964
|
-
if (!fs4.lutimes) {
|
1965
|
-
patchLutimes(fs4);
|
1966
|
-
}
|
1967
|
-
fs4.chown = chownFix(fs4.chown);
|
1968
|
-
fs4.fchown = chownFix(fs4.fchown);
|
1969
|
-
fs4.lchown = chownFix(fs4.lchown);
|
1970
|
-
fs4.chmod = chmodFix(fs4.chmod);
|
1971
|
-
fs4.fchmod = chmodFix(fs4.fchmod);
|
1972
|
-
fs4.lchmod = chmodFix(fs4.lchmod);
|
1973
|
-
fs4.chownSync = chownFixSync(fs4.chownSync);
|
1974
|
-
fs4.fchownSync = chownFixSync(fs4.fchownSync);
|
1975
|
-
fs4.lchownSync = chownFixSync(fs4.lchownSync);
|
1976
|
-
fs4.chmodSync = chmodFixSync(fs4.chmodSync);
|
1977
|
-
fs4.fchmodSync = chmodFixSync(fs4.fchmodSync);
|
1978
|
-
fs4.lchmodSync = chmodFixSync(fs4.lchmodSync);
|
1979
|
-
fs4.stat = statFix(fs4.stat);
|
1980
|
-
fs4.fstat = statFix(fs4.fstat);
|
1981
|
-
fs4.lstat = statFix(fs4.lstat);
|
1982
|
-
fs4.statSync = statFixSync(fs4.statSync);
|
1983
|
-
fs4.fstatSync = statFixSync(fs4.fstatSync);
|
1984
|
-
fs4.lstatSync = statFixSync(fs4.lstatSync);
|
1985
|
-
if (fs4.chmod && !fs4.lchmod) {
|
1986
|
-
fs4.lchmod = function(path6, mode, cb) {
|
1987
|
-
if (cb) process.nextTick(cb);
|
1988
|
-
};
|
1989
|
-
fs4.lchmodSync = function() {
|
1990
|
-
};
|
1991
|
-
}
|
1992
|
-
if (fs4.chown && !fs4.lchown) {
|
1993
|
-
fs4.lchown = function(path6, uid, gid, cb) {
|
1994
|
-
if (cb) process.nextTick(cb);
|
1995
|
-
};
|
1996
|
-
fs4.lchownSync = function() {
|
1997
|
-
};
|
1998
|
-
}
|
1999
|
-
if (platform === "win32") {
|
2000
|
-
fs4.rename = typeof fs4.rename !== "function" ? fs4.rename : function(fs$rename) {
|
2001
|
-
function rename(from, to, cb) {
|
2002
|
-
var start = Date.now();
|
2003
|
-
var backoff = 0;
|
2004
|
-
fs$rename(from, to, function CB(er) {
|
2005
|
-
if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
|
2006
|
-
setTimeout(function() {
|
2007
|
-
fs4.stat(to, function(stater, st) {
|
2008
|
-
if (stater && stater.code === "ENOENT")
|
2009
|
-
fs$rename(from, to, CB);
|
2010
|
-
else
|
2011
|
-
cb(er);
|
2012
|
-
});
|
2013
|
-
}, backoff);
|
2014
|
-
if (backoff < 100)
|
2015
|
-
backoff += 10;
|
2016
|
-
return;
|
2017
|
-
}
|
2018
|
-
if (cb) cb(er);
|
2019
|
-
});
|
2020
|
-
}
|
2021
|
-
if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename);
|
2022
|
-
return rename;
|
2023
|
-
}(fs4.rename);
|
2024
|
-
}
|
2025
|
-
fs4.read = typeof fs4.read !== "function" ? fs4.read : function(fs$read) {
|
2026
|
-
function read(fd, buffer, offset, length, position, callback_) {
|
2027
|
-
var callback;
|
2028
|
-
if (callback_ && typeof callback_ === "function") {
|
2029
|
-
var eagCounter = 0;
|
2030
|
-
callback = function(er, _, __) {
|
2031
|
-
if (er && er.code === "EAGAIN" && eagCounter < 10) {
|
2032
|
-
eagCounter++;
|
2033
|
-
return fs$read.call(fs4, fd, buffer, offset, length, position, callback);
|
2034
|
-
}
|
2035
|
-
callback_.apply(this, arguments);
|
2036
|
-
};
|
2037
|
-
}
|
2038
|
-
return fs$read.call(fs4, fd, buffer, offset, length, position, callback);
|
2039
|
-
}
|
2040
|
-
if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read);
|
2041
|
-
return read;
|
2042
|
-
}(fs4.read);
|
2043
|
-
fs4.readSync = typeof fs4.readSync !== "function" ? fs4.readSync : /* @__PURE__ */ function(fs$readSync) {
|
2044
|
-
return function(fd, buffer, offset, length, position) {
|
2045
|
-
var eagCounter = 0;
|
2046
|
-
while (true) {
|
2047
|
-
try {
|
2048
|
-
return fs$readSync.call(fs4, fd, buffer, offset, length, position);
|
2049
|
-
} catch (er) {
|
2050
|
-
if (er.code === "EAGAIN" && eagCounter < 10) {
|
2051
|
-
eagCounter++;
|
2052
|
-
continue;
|
2053
|
-
}
|
2054
|
-
throw er;
|
2055
|
-
}
|
2056
|
-
}
|
2057
|
-
};
|
2058
|
-
}(fs4.readSync);
|
2059
|
-
function patchLchmod(fs5) {
|
2060
|
-
fs5.lchmod = function(path6, mode, callback) {
|
2061
|
-
fs5.open(
|
2062
|
-
path6,
|
2063
|
-
constants.O_WRONLY | constants.O_SYMLINK,
|
2064
|
-
mode,
|
2065
|
-
function(err, fd) {
|
2066
|
-
if (err) {
|
2067
|
-
if (callback) callback(err);
|
2068
|
-
return;
|
2069
|
-
}
|
2070
|
-
fs5.fchmod(fd, mode, function(err2) {
|
2071
|
-
fs5.close(fd, function(err22) {
|
2072
|
-
if (callback) callback(err2 || err22);
|
2073
|
-
});
|
2074
|
-
});
|
2075
|
-
}
|
2076
|
-
);
|
2077
|
-
};
|
2078
|
-
fs5.lchmodSync = function(path6, mode) {
|
2079
|
-
var fd = fs5.openSync(path6, constants.O_WRONLY | constants.O_SYMLINK, mode);
|
2080
|
-
var threw = true;
|
2081
|
-
var ret;
|
2082
|
-
try {
|
2083
|
-
ret = fs5.fchmodSync(fd, mode);
|
2084
|
-
threw = false;
|
2085
|
-
} finally {
|
2086
|
-
if (threw) {
|
2087
|
-
try {
|
2088
|
-
fs5.closeSync(fd);
|
2089
|
-
} catch (er) {
|
2090
|
-
}
|
2091
|
-
} else {
|
2092
|
-
fs5.closeSync(fd);
|
2093
|
-
}
|
2094
|
-
}
|
2095
|
-
return ret;
|
2096
|
-
};
|
2097
|
-
}
|
2098
|
-
function patchLutimes(fs5) {
|
2099
|
-
if (constants.hasOwnProperty("O_SYMLINK") && fs5.futimes) {
|
2100
|
-
fs5.lutimes = function(path6, at, mt, cb) {
|
2101
|
-
fs5.open(path6, constants.O_SYMLINK, function(er, fd) {
|
2102
|
-
if (er) {
|
2103
|
-
if (cb) cb(er);
|
2104
|
-
return;
|
2105
|
-
}
|
2106
|
-
fs5.futimes(fd, at, mt, function(er2) {
|
2107
|
-
fs5.close(fd, function(er22) {
|
2108
|
-
if (cb) cb(er2 || er22);
|
2109
|
-
});
|
2110
|
-
});
|
2111
|
-
});
|
2112
|
-
};
|
2113
|
-
fs5.lutimesSync = function(path6, at, mt) {
|
2114
|
-
var fd = fs5.openSync(path6, constants.O_SYMLINK);
|
2115
|
-
var ret;
|
2116
|
-
var threw = true;
|
2117
|
-
try {
|
2118
|
-
ret = fs5.futimesSync(fd, at, mt);
|
2119
|
-
threw = false;
|
2120
|
-
} finally {
|
2121
|
-
if (threw) {
|
2122
|
-
try {
|
2123
|
-
fs5.closeSync(fd);
|
2124
|
-
} catch (er) {
|
2125
|
-
}
|
2126
|
-
} else {
|
2127
|
-
fs5.closeSync(fd);
|
2128
|
-
}
|
2129
|
-
}
|
2130
|
-
return ret;
|
2131
|
-
};
|
2132
|
-
} else if (fs5.futimes) {
|
2133
|
-
fs5.lutimes = function(_a, _b, _c, cb) {
|
2134
|
-
if (cb) process.nextTick(cb);
|
2135
|
-
};
|
2136
|
-
fs5.lutimesSync = function() {
|
2137
|
-
};
|
2138
|
-
}
|
2139
|
-
}
|
2140
|
-
function chmodFix(orig) {
|
2141
|
-
if (!orig) return orig;
|
2142
|
-
return function(target, mode, cb) {
|
2143
|
-
return orig.call(fs4, target, mode, function(er) {
|
2144
|
-
if (chownErOk(er)) er = null;
|
2145
|
-
if (cb) cb.apply(this, arguments);
|
2146
|
-
});
|
2147
|
-
};
|
2148
|
-
}
|
2149
|
-
function chmodFixSync(orig) {
|
2150
|
-
if (!orig) return orig;
|
2151
|
-
return function(target, mode) {
|
2152
|
-
try {
|
2153
|
-
return orig.call(fs4, target, mode);
|
2154
|
-
} catch (er) {
|
2155
|
-
if (!chownErOk(er)) throw er;
|
2156
|
-
}
|
2157
|
-
};
|
2158
|
-
}
|
2159
|
-
function chownFix(orig) {
|
2160
|
-
if (!orig) return orig;
|
2161
|
-
return function(target, uid, gid, cb) {
|
2162
|
-
return orig.call(fs4, target, uid, gid, function(er) {
|
2163
|
-
if (chownErOk(er)) er = null;
|
2164
|
-
if (cb) cb.apply(this, arguments);
|
2165
|
-
});
|
2166
|
-
};
|
2167
|
-
}
|
2168
|
-
function chownFixSync(orig) {
|
2169
|
-
if (!orig) return orig;
|
2170
|
-
return function(target, uid, gid) {
|
2171
|
-
try {
|
2172
|
-
return orig.call(fs4, target, uid, gid);
|
2173
|
-
} catch (er) {
|
2174
|
-
if (!chownErOk(er)) throw er;
|
2175
|
-
}
|
2176
|
-
};
|
2177
|
-
}
|
2178
|
-
function statFix(orig) {
|
2179
|
-
if (!orig) return orig;
|
2180
|
-
return function(target, options, cb) {
|
2181
|
-
if (typeof options === "function") {
|
2182
|
-
cb = options;
|
2183
|
-
options = null;
|
2184
|
-
}
|
2185
|
-
function callback(er, stats) {
|
2186
|
-
if (stats) {
|
2187
|
-
if (stats.uid < 0) stats.uid += 4294967296;
|
2188
|
-
if (stats.gid < 0) stats.gid += 4294967296;
|
2189
|
-
}
|
2190
|
-
if (cb) cb.apply(this, arguments);
|
2191
|
-
}
|
2192
|
-
return options ? orig.call(fs4, target, options, callback) : orig.call(fs4, target, callback);
|
2193
|
-
};
|
2194
|
-
}
|
2195
|
-
function statFixSync(orig) {
|
2196
|
-
if (!orig) return orig;
|
2197
|
-
return function(target, options) {
|
2198
|
-
var stats = options ? orig.call(fs4, target, options) : orig.call(fs4, target);
|
2199
|
-
if (stats) {
|
2200
|
-
if (stats.uid < 0) stats.uid += 4294967296;
|
2201
|
-
if (stats.gid < 0) stats.gid += 4294967296;
|
2202
|
-
}
|
2203
|
-
return stats;
|
2204
|
-
};
|
2205
|
-
}
|
2206
|
-
function chownErOk(er) {
|
2207
|
-
if (!er)
|
2208
|
-
return true;
|
2209
|
-
if (er.code === "ENOSYS")
|
2210
|
-
return true;
|
2211
|
-
var nonroot = !process.getuid || process.getuid() !== 0;
|
2212
|
-
if (nonroot) {
|
2213
|
-
if (er.code === "EINVAL" || er.code === "EPERM")
|
2214
|
-
return true;
|
2215
|
-
}
|
2216
|
-
return false;
|
2217
|
-
}
|
2218
|
-
}
|
2219
|
-
}
|
2220
|
-
});
|
2221
|
-
var require_legacy_streams2 = (0, import_chunk_AH6QHEOA.__commonJS)({
|
2222
|
-
"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js"(exports, module2) {
|
2223
|
-
"use strict";
|
2224
|
-
var Stream = (0, import_chunk_AH6QHEOA.__require)("stream").Stream;
|
2225
|
-
module2.exports = legacy;
|
2226
|
-
function legacy(fs4) {
|
2227
|
-
return {
|
2228
|
-
ReadStream,
|
2229
|
-
WriteStream
|
2230
|
-
};
|
2231
|
-
function ReadStream(path6, options) {
|
2232
|
-
if (!(this instanceof ReadStream)) return new ReadStream(path6, options);
|
2233
|
-
Stream.call(this);
|
2234
|
-
var self = this;
|
2235
|
-
this.path = path6;
|
2236
|
-
this.fd = null;
|
2237
|
-
this.readable = true;
|
2238
|
-
this.paused = false;
|
2239
|
-
this.flags = "r";
|
2240
|
-
this.mode = 438;
|
2241
|
-
this.bufferSize = 64 * 1024;
|
2242
|
-
options = options || {};
|
2243
|
-
var keys = Object.keys(options);
|
2244
|
-
for (var index = 0, length = keys.length; index < length; index++) {
|
2245
|
-
var key = keys[index];
|
2246
|
-
this[key] = options[key];
|
2247
|
-
}
|
2248
|
-
if (this.encoding) this.setEncoding(this.encoding);
|
2249
|
-
if (this.start !== void 0) {
|
2250
|
-
if ("number" !== typeof this.start) {
|
2251
|
-
throw TypeError("start must be a Number");
|
2252
|
-
}
|
2253
|
-
if (this.end === void 0) {
|
2254
|
-
this.end = Infinity;
|
2255
|
-
} else if ("number" !== typeof this.end) {
|
2256
|
-
throw TypeError("end must be a Number");
|
2257
|
-
}
|
2258
|
-
if (this.start > this.end) {
|
2259
|
-
throw new Error("start must be <= end");
|
2260
|
-
}
|
2261
|
-
this.pos = this.start;
|
2262
|
-
}
|
2263
|
-
if (this.fd !== null) {
|
2264
|
-
process.nextTick(function() {
|
2265
|
-
self._read();
|
2266
|
-
});
|
2267
|
-
return;
|
2268
|
-
}
|
2269
|
-
fs4.open(this.path, this.flags, this.mode, function(err, fd) {
|
2270
|
-
if (err) {
|
2271
|
-
self.emit("error", err);
|
2272
|
-
self.readable = false;
|
2273
|
-
return;
|
2274
|
-
}
|
2275
|
-
self.fd = fd;
|
2276
|
-
self.emit("open", fd);
|
2277
|
-
self._read();
|
2278
|
-
});
|
2279
|
-
}
|
2280
|
-
function WriteStream(path6, options) {
|
2281
|
-
if (!(this instanceof WriteStream)) return new WriteStream(path6, options);
|
2282
|
-
Stream.call(this);
|
2283
|
-
this.path = path6;
|
2284
|
-
this.fd = null;
|
2285
|
-
this.writable = true;
|
2286
|
-
this.flags = "w";
|
2287
|
-
this.encoding = "binary";
|
2288
|
-
this.mode = 438;
|
2289
|
-
this.bytesWritten = 0;
|
2290
|
-
options = options || {};
|
2291
|
-
var keys = Object.keys(options);
|
2292
|
-
for (var index = 0, length = keys.length; index < length; index++) {
|
2293
|
-
var key = keys[index];
|
2294
|
-
this[key] = options[key];
|
2295
|
-
}
|
2296
|
-
if (this.start !== void 0) {
|
2297
|
-
if ("number" !== typeof this.start) {
|
2298
|
-
throw TypeError("start must be a Number");
|
2299
|
-
}
|
2300
|
-
if (this.start < 0) {
|
2301
|
-
throw new Error("start must be >= zero");
|
2302
|
-
}
|
2303
|
-
this.pos = this.start;
|
2304
|
-
}
|
2305
|
-
this.busy = false;
|
2306
|
-
this._queue = [];
|
2307
|
-
if (this.fd === null) {
|
2308
|
-
this._open = fs4.open;
|
2309
|
-
this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
|
2310
|
-
this.flush();
|
2311
|
-
}
|
2312
|
-
}
|
2313
|
-
}
|
2314
|
-
}
|
2315
|
-
});
|
2316
|
-
var require_clone2 = (0, import_chunk_AH6QHEOA.__commonJS)({
|
2317
|
-
"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/clone.js"(exports, module2) {
|
2318
|
-
"use strict";
|
2319
|
-
module2.exports = clone;
|
2320
|
-
var getPrototypeOf = Object.getPrototypeOf || function(obj) {
|
2321
|
-
return obj.__proto__;
|
2322
|
-
};
|
2323
|
-
function clone(obj) {
|
2324
|
-
if (obj === null || typeof obj !== "object")
|
2325
|
-
return obj;
|
2326
|
-
if (obj instanceof Object)
|
2327
|
-
var copy = { __proto__: getPrototypeOf(obj) };
|
2328
|
-
else
|
2329
|
-
var copy = /* @__PURE__ */ Object.create(null);
|
2330
|
-
Object.getOwnPropertyNames(obj).forEach(function(key) {
|
2331
|
-
Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key));
|
2332
|
-
});
|
2333
|
-
return copy;
|
2334
|
-
}
|
2335
|
-
}
|
2336
|
-
});
|
2337
|
-
var require_graceful_fs2 = (0, import_chunk_AH6QHEOA.__commonJS)({
|
2338
|
-
"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js"(exports, module2) {
|
2339
|
-
"use strict";
|
2340
|
-
var fs4 = (0, import_chunk_AH6QHEOA.__require)("fs");
|
2341
|
-
var polyfills = require_polyfills2();
|
2342
|
-
var legacy = require_legacy_streams2();
|
2343
|
-
var clone = require_clone2();
|
2344
|
-
var util = (0, import_chunk_AH6QHEOA.__require)("util");
|
2345
|
-
var gracefulQueue;
|
2346
|
-
var previousSymbol;
|
2347
|
-
if (typeof Symbol === "function" && typeof Symbol.for === "function") {
|
2348
|
-
gracefulQueue = Symbol.for("graceful-fs.queue");
|
2349
|
-
previousSymbol = Symbol.for("graceful-fs.previous");
|
2350
|
-
} else {
|
2351
|
-
gracefulQueue = "___graceful-fs.queue";
|
2352
|
-
previousSymbol = "___graceful-fs.previous";
|
2353
|
-
}
|
2354
|
-
function noop() {
|
2355
|
-
}
|
2356
|
-
function publishQueue(context, queue2) {
|
2357
|
-
Object.defineProperty(context, gracefulQueue, {
|
2358
|
-
get: function() {
|
2359
|
-
return queue2;
|
2360
|
-
}
|
2361
|
-
});
|
2362
|
-
}
|
2363
|
-
var debug2 = noop;
|
2364
|
-
if (util.debuglog)
|
2365
|
-
debug2 = util.debuglog("gfs4");
|
2366
|
-
else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ""))
|
2367
|
-
debug2 = function() {
|
2368
|
-
var m = util.format.apply(util, arguments);
|
2369
|
-
m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
|
2370
|
-
console.error(m);
|
2371
|
-
};
|
2372
|
-
if (!fs4[gracefulQueue]) {
|
2373
|
-
queue = global[gracefulQueue] || [];
|
2374
|
-
publishQueue(fs4, queue);
|
2375
|
-
fs4.close = function(fs$close) {
|
2376
|
-
function close(fd, cb) {
|
2377
|
-
return fs$close.call(fs4, fd, function(err) {
|
2378
|
-
if (!err) {
|
2379
|
-
resetQueue();
|
2380
|
-
}
|
2381
|
-
if (typeof cb === "function")
|
2382
|
-
cb.apply(this, arguments);
|
2383
|
-
});
|
2384
|
-
}
|
2385
|
-
Object.defineProperty(close, previousSymbol, {
|
2386
|
-
value: fs$close
|
2387
|
-
});
|
2388
|
-
return close;
|
2389
|
-
}(fs4.close);
|
2390
|
-
fs4.closeSync = function(fs$closeSync) {
|
2391
|
-
function closeSync(fd) {
|
2392
|
-
fs$closeSync.apply(fs4, arguments);
|
2393
|
-
resetQueue();
|
2394
|
-
}
|
2395
|
-
Object.defineProperty(closeSync, previousSymbol, {
|
2396
|
-
value: fs$closeSync
|
2397
|
-
});
|
2398
|
-
return closeSync;
|
2399
|
-
}(fs4.closeSync);
|
2400
|
-
if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
|
2401
|
-
process.on("exit", function() {
|
2402
|
-
debug2(fs4[gracefulQueue]);
|
2403
|
-
(0, import_chunk_AH6QHEOA.__require)("assert").equal(fs4[gracefulQueue].length, 0);
|
2404
|
-
});
|
2405
|
-
}
|
2406
|
-
}
|
2407
|
-
var queue;
|
2408
|
-
if (!global[gracefulQueue]) {
|
2409
|
-
publishQueue(global, fs4[gracefulQueue]);
|
2410
|
-
}
|
2411
|
-
module2.exports = patch(clone(fs4));
|
2412
|
-
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs4.__patched) {
|
2413
|
-
module2.exports = patch(fs4);
|
2414
|
-
fs4.__patched = true;
|
2415
|
-
}
|
2416
|
-
function patch(fs5) {
|
2417
|
-
polyfills(fs5);
|
2418
|
-
fs5.gracefulify = patch;
|
2419
|
-
fs5.createReadStream = createReadStream;
|
2420
|
-
fs5.createWriteStream = createWriteStream;
|
2421
|
-
var fs$readFile = fs5.readFile;
|
2422
|
-
fs5.readFile = readFile;
|
2423
|
-
function readFile(path6, options, cb) {
|
2424
|
-
if (typeof options === "function")
|
2425
|
-
cb = options, options = null;
|
2426
|
-
return go$readFile(path6, options, cb);
|
2427
|
-
function go$readFile(path7, options2, cb2, startTime) {
|
2428
|
-
return fs$readFile(path7, options2, function(err) {
|
2429
|
-
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
2430
|
-
enqueue([go$readFile, [path7, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
2431
|
-
else {
|
2432
|
-
if (typeof cb2 === "function")
|
2433
|
-
cb2.apply(this, arguments);
|
2434
|
-
}
|
2435
|
-
});
|
2436
|
-
}
|
2437
|
-
}
|
2438
|
-
var fs$writeFile = fs5.writeFile;
|
2439
|
-
fs5.writeFile = writeFile;
|
2440
|
-
function writeFile(path6, data, options, cb) {
|
2441
|
-
if (typeof options === "function")
|
2442
|
-
cb = options, options = null;
|
2443
|
-
return go$writeFile(path6, data, options, cb);
|
2444
|
-
function go$writeFile(path7, data2, options2, cb2, startTime) {
|
2445
|
-
return fs$writeFile(path7, data2, options2, function(err) {
|
2446
|
-
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
2447
|
-
enqueue([go$writeFile, [path7, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
2448
|
-
else {
|
2449
|
-
if (typeof cb2 === "function")
|
2450
|
-
cb2.apply(this, arguments);
|
2451
|
-
}
|
2452
|
-
});
|
2453
|
-
}
|
2454
|
-
}
|
2455
|
-
var fs$appendFile = fs5.appendFile;
|
2456
|
-
if (fs$appendFile)
|
2457
|
-
fs5.appendFile = appendFile;
|
2458
|
-
function appendFile(path6, data, options, cb) {
|
2459
|
-
if (typeof options === "function")
|
2460
|
-
cb = options, options = null;
|
2461
|
-
return go$appendFile(path6, data, options, cb);
|
2462
|
-
function go$appendFile(path7, data2, options2, cb2, startTime) {
|
2463
|
-
return fs$appendFile(path7, data2, options2, function(err) {
|
2464
|
-
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
2465
|
-
enqueue([go$appendFile, [path7, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
2466
|
-
else {
|
2467
|
-
if (typeof cb2 === "function")
|
2468
|
-
cb2.apply(this, arguments);
|
2469
|
-
}
|
2470
|
-
});
|
2471
|
-
}
|
2472
|
-
}
|
2473
|
-
var fs$copyFile = fs5.copyFile;
|
2474
|
-
if (fs$copyFile)
|
2475
|
-
fs5.copyFile = copyFile;
|
2476
|
-
function copyFile(src, dest, flags, cb) {
|
2477
|
-
if (typeof flags === "function") {
|
2478
|
-
cb = flags;
|
2479
|
-
flags = 0;
|
2480
|
-
}
|
2481
|
-
return go$copyFile(src, dest, flags, cb);
|
2482
|
-
function go$copyFile(src2, dest2, flags2, cb2, startTime) {
|
2483
|
-
return fs$copyFile(src2, dest2, flags2, function(err) {
|
2484
|
-
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
2485
|
-
enqueue([go$copyFile, [src2, dest2, flags2, cb2], err, startTime || Date.now(), Date.now()]);
|
2486
|
-
else {
|
2487
|
-
if (typeof cb2 === "function")
|
2488
|
-
cb2.apply(this, arguments);
|
2489
|
-
}
|
2490
|
-
});
|
2491
|
-
}
|
2492
|
-
}
|
2493
|
-
var fs$readdir = fs5.readdir;
|
2494
|
-
fs5.readdir = readdir;
|
2495
|
-
var noReaddirOptionVersions = /^v[0-5]\./;
|
2496
|
-
function readdir(path6, options, cb) {
|
2497
|
-
if (typeof options === "function")
|
2498
|
-
cb = options, options = null;
|
2499
|
-
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path7, options2, cb2, startTime) {
|
2500
|
-
return fs$readdir(path7, fs$readdirCallback(
|
2501
|
-
path7,
|
2502
|
-
options2,
|
2503
|
-
cb2,
|
2504
|
-
startTime
|
2505
|
-
));
|
2506
|
-
} : function go$readdir2(path7, options2, cb2, startTime) {
|
2507
|
-
return fs$readdir(path7, options2, fs$readdirCallback(
|
2508
|
-
path7,
|
2509
|
-
options2,
|
2510
|
-
cb2,
|
2511
|
-
startTime
|
2512
|
-
));
|
2513
|
-
};
|
2514
|
-
return go$readdir(path6, options, cb);
|
2515
|
-
function fs$readdirCallback(path7, options2, cb2, startTime) {
|
2516
|
-
return function(err, files) {
|
2517
|
-
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
2518
|
-
enqueue([
|
2519
|
-
go$readdir,
|
2520
|
-
[path7, options2, cb2],
|
2521
|
-
err,
|
2522
|
-
startTime || Date.now(),
|
2523
|
-
Date.now()
|
2524
|
-
]);
|
2525
|
-
else {
|
2526
|
-
if (files && files.sort)
|
2527
|
-
files.sort();
|
2528
|
-
if (typeof cb2 === "function")
|
2529
|
-
cb2.call(this, err, files);
|
2530
|
-
}
|
2531
|
-
};
|
2532
|
-
}
|
2533
|
-
}
|
2534
|
-
if (process.version.substr(0, 4) === "v0.8") {
|
2535
|
-
var legStreams = legacy(fs5);
|
2536
|
-
ReadStream = legStreams.ReadStream;
|
2537
|
-
WriteStream = legStreams.WriteStream;
|
2538
|
-
}
|
2539
|
-
var fs$ReadStream = fs5.ReadStream;
|
2540
|
-
if (fs$ReadStream) {
|
2541
|
-
ReadStream.prototype = Object.create(fs$ReadStream.prototype);
|
2542
|
-
ReadStream.prototype.open = ReadStream$open;
|
2543
|
-
}
|
2544
|
-
var fs$WriteStream = fs5.WriteStream;
|
2545
|
-
if (fs$WriteStream) {
|
2546
|
-
WriteStream.prototype = Object.create(fs$WriteStream.prototype);
|
2547
|
-
WriteStream.prototype.open = WriteStream$open;
|
2548
|
-
}
|
2549
|
-
Object.defineProperty(fs5, "ReadStream", {
|
2550
|
-
get: function() {
|
2551
|
-
return ReadStream;
|
2552
|
-
},
|
2553
|
-
set: function(val) {
|
2554
|
-
ReadStream = val;
|
2555
|
-
},
|
2556
|
-
enumerable: true,
|
2557
|
-
configurable: true
|
2558
|
-
});
|
2559
|
-
Object.defineProperty(fs5, "WriteStream", {
|
2560
|
-
get: function() {
|
2561
|
-
return WriteStream;
|
2562
|
-
},
|
2563
|
-
set: function(val) {
|
2564
|
-
WriteStream = val;
|
2565
|
-
},
|
2566
|
-
enumerable: true,
|
2567
|
-
configurable: true
|
2568
|
-
});
|
2569
|
-
var FileReadStream = ReadStream;
|
2570
|
-
Object.defineProperty(fs5, "FileReadStream", {
|
2571
|
-
get: function() {
|
2572
|
-
return FileReadStream;
|
2573
|
-
},
|
2574
|
-
set: function(val) {
|
2575
|
-
FileReadStream = val;
|
2576
|
-
},
|
2577
|
-
enumerable: true,
|
2578
|
-
configurable: true
|
2579
|
-
});
|
2580
|
-
var FileWriteStream = WriteStream;
|
2581
|
-
Object.defineProperty(fs5, "FileWriteStream", {
|
2582
|
-
get: function() {
|
2583
|
-
return FileWriteStream;
|
2584
|
-
},
|
2585
|
-
set: function(val) {
|
2586
|
-
FileWriteStream = val;
|
2587
|
-
},
|
2588
|
-
enumerable: true,
|
2589
|
-
configurable: true
|
2590
|
-
});
|
2591
|
-
function ReadStream(path6, options) {
|
2592
|
-
if (this instanceof ReadStream)
|
2593
|
-
return fs$ReadStream.apply(this, arguments), this;
|
2594
|
-
else
|
2595
|
-
return ReadStream.apply(Object.create(ReadStream.prototype), arguments);
|
2596
|
-
}
|
2597
|
-
function ReadStream$open() {
|
2598
|
-
var that = this;
|
2599
|
-
open(that.path, that.flags, that.mode, function(err, fd) {
|
2600
|
-
if (err) {
|
2601
|
-
if (that.autoClose)
|
2602
|
-
that.destroy();
|
2603
|
-
that.emit("error", err);
|
2604
|
-
} else {
|
2605
|
-
that.fd = fd;
|
2606
|
-
that.emit("open", fd);
|
2607
|
-
that.read();
|
2608
|
-
}
|
2609
|
-
});
|
2610
|
-
}
|
2611
|
-
function WriteStream(path6, options) {
|
2612
|
-
if (this instanceof WriteStream)
|
2613
|
-
return fs$WriteStream.apply(this, arguments), this;
|
2614
|
-
else
|
2615
|
-
return WriteStream.apply(Object.create(WriteStream.prototype), arguments);
|
2616
|
-
}
|
2617
|
-
function WriteStream$open() {
|
2618
|
-
var that = this;
|
2619
|
-
open(that.path, that.flags, that.mode, function(err, fd) {
|
2620
|
-
if (err) {
|
2621
|
-
that.destroy();
|
2622
|
-
that.emit("error", err);
|
2623
|
-
} else {
|
2624
|
-
that.fd = fd;
|
2625
|
-
that.emit("open", fd);
|
2626
|
-
}
|
2627
|
-
});
|
2628
|
-
}
|
2629
|
-
function createReadStream(path6, options) {
|
2630
|
-
return new fs5.ReadStream(path6, options);
|
2631
|
-
}
|
2632
|
-
function createWriteStream(path6, options) {
|
2633
|
-
return new fs5.WriteStream(path6, options);
|
2634
|
-
}
|
2635
|
-
var fs$open = fs5.open;
|
2636
|
-
fs5.open = open;
|
2637
|
-
function open(path6, flags, mode, cb) {
|
2638
|
-
if (typeof mode === "function")
|
2639
|
-
cb = mode, mode = null;
|
2640
|
-
return go$open(path6, flags, mode, cb);
|
2641
|
-
function go$open(path7, flags2, mode2, cb2, startTime) {
|
2642
|
-
return fs$open(path7, flags2, mode2, function(err, fd) {
|
2643
|
-
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
2644
|
-
enqueue([go$open, [path7, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
|
2645
|
-
else {
|
2646
|
-
if (typeof cb2 === "function")
|
2647
|
-
cb2.apply(this, arguments);
|
2648
|
-
}
|
2649
|
-
});
|
2650
|
-
}
|
2651
|
-
}
|
2652
|
-
return fs5;
|
2653
|
-
}
|
2654
|
-
function enqueue(elem) {
|
2655
|
-
debug2("ENQUEUE", elem[0].name, elem[1]);
|
2656
|
-
fs4[gracefulQueue].push(elem);
|
2657
|
-
retry();
|
2658
|
-
}
|
2659
|
-
var retryTimer;
|
2660
|
-
function resetQueue() {
|
2661
|
-
var now = Date.now();
|
2662
|
-
for (var i = 0; i < fs4[gracefulQueue].length; ++i) {
|
2663
|
-
if (fs4[gracefulQueue][i].length > 2) {
|
2664
|
-
fs4[gracefulQueue][i][3] = now;
|
2665
|
-
fs4[gracefulQueue][i][4] = now;
|
2666
|
-
}
|
1798
|
+
if (!await pathExists2(dir)) {
|
1799
|
+
await mkdirs(dir);
|
2667
1800
|
}
|
2668
|
-
|
1801
|
+
return fs4.symlink(srcpath, dstpath, toType);
|
2669
1802
|
}
|
2670
|
-
function
|
2671
|
-
|
2672
|
-
|
2673
|
-
|
2674
|
-
|
2675
|
-
var elem = fs4[gracefulQueue].shift();
|
2676
|
-
var fn = elem[0];
|
2677
|
-
var args = elem[1];
|
2678
|
-
var err = elem[2];
|
2679
|
-
var startTime = elem[3];
|
2680
|
-
var lastTime = elem[4];
|
2681
|
-
if (startTime === void 0) {
|
2682
|
-
debug2("RETRY", fn.name, args);
|
2683
|
-
fn.apply(null, args);
|
2684
|
-
} else if (Date.now() - startTime >= 6e4) {
|
2685
|
-
debug2("TIMEOUT", fn.name, args);
|
2686
|
-
var cb = args.pop();
|
2687
|
-
if (typeof cb === "function")
|
2688
|
-
cb.call(null, err);
|
2689
|
-
} else {
|
2690
|
-
var sinceAttempt = Date.now() - lastTime;
|
2691
|
-
var sinceStart = Math.max(lastTime - startTime, 1);
|
2692
|
-
var desiredDelay = Math.min(sinceStart * 1.2, 100);
|
2693
|
-
if (sinceAttempt >= desiredDelay) {
|
2694
|
-
debug2("RETRY", fn.name, args);
|
2695
|
-
fn.apply(null, args.concat([startTime]));
|
2696
|
-
} else {
|
2697
|
-
fs4[gracefulQueue].push(elem);
|
2698
|
-
}
|
1803
|
+
function createSymlinkSync(srcpath, dstpath, type) {
|
1804
|
+
let stats;
|
1805
|
+
try {
|
1806
|
+
stats = fs4.lstatSync(dstpath);
|
1807
|
+
} catch {
|
2699
1808
|
}
|
2700
|
-
if (
|
2701
|
-
|
1809
|
+
if (stats && stats.isSymbolicLink()) {
|
1810
|
+
const srcStat = fs4.statSync(srcpath);
|
1811
|
+
const dstStat = fs4.statSync(dstpath);
|
1812
|
+
if (areIdentical(srcStat, dstStat)) return;
|
2702
1813
|
}
|
1814
|
+
const relative = symlinkPathsSync(srcpath, dstpath);
|
1815
|
+
srcpath = relative.toDst;
|
1816
|
+
type = symlinkTypeSync(relative.toCwd, type);
|
1817
|
+
const dir = path6.dirname(dstpath);
|
1818
|
+
const exists = fs4.existsSync(dir);
|
1819
|
+
if (exists) return fs4.symlinkSync(srcpath, dstpath, type);
|
1820
|
+
mkdirsSync(dir);
|
1821
|
+
return fs4.symlinkSync(srcpath, dstpath, type);
|
2703
1822
|
}
|
1823
|
+
module2.exports = {
|
1824
|
+
createSymlink: u(createSymlink),
|
1825
|
+
createSymlinkSync
|
1826
|
+
};
|
1827
|
+
}
|
1828
|
+
});
|
1829
|
+
var require_ensure = (0, import_chunk_AH6QHEOA.__commonJS)({
|
1830
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/ensure/index.js"(exports, module2) {
|
1831
|
+
"use strict";
|
1832
|
+
var { createFile, createFileSync } = require_file();
|
1833
|
+
var { createLink, createLinkSync } = require_link();
|
1834
|
+
var { createSymlink, createSymlinkSync } = require_symlink();
|
1835
|
+
module2.exports = {
|
1836
|
+
// file
|
1837
|
+
createFile,
|
1838
|
+
createFileSync,
|
1839
|
+
ensureFile: createFile,
|
1840
|
+
ensureFileSync: createFileSync,
|
1841
|
+
// link
|
1842
|
+
createLink,
|
1843
|
+
createLinkSync,
|
1844
|
+
ensureLink: createLink,
|
1845
|
+
ensureLinkSync: createLinkSync,
|
1846
|
+
// symlink
|
1847
|
+
createSymlink,
|
1848
|
+
createSymlinkSync,
|
1849
|
+
ensureSymlink: createSymlink,
|
1850
|
+
ensureSymlinkSync: createSymlinkSync
|
1851
|
+
};
|
2704
1852
|
}
|
2705
1853
|
});
|
2706
1854
|
var require_utils2 = (0, import_chunk_AH6QHEOA.__commonJS)({
|
@@ -2723,7 +1871,7 @@ var require_jsonfile = (0, import_chunk_AH6QHEOA.__commonJS)({
|
|
2723
1871
|
"use strict";
|
2724
1872
|
var _fs;
|
2725
1873
|
try {
|
2726
|
-
_fs =
|
1874
|
+
_fs = require_graceful_fs();
|
2727
1875
|
} catch (_) {
|
2728
1876
|
_fs = (0, import_chunk_AH6QHEOA.__require)("fs");
|
2729
1877
|
}
|
@@ -2791,7 +1939,7 @@ var require_jsonfile = (0, import_chunk_AH6QHEOA.__commonJS)({
|
|
2791
1939
|
}
|
2792
1940
|
});
|
2793
1941
|
var require_jsonfile2 = (0, import_chunk_AH6QHEOA.__commonJS)({
|
2794
|
-
"../../node_modules/.pnpm/fs-extra@11.
|
1942
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/json/jsonfile.js"(exports, module2) {
|
2795
1943
|
"use strict";
|
2796
1944
|
var jsonFile = require_jsonfile();
|
2797
1945
|
module2.exports = {
|
@@ -2804,34 +1952,25 @@ var require_jsonfile2 = (0, import_chunk_AH6QHEOA.__commonJS)({
|
|
2804
1952
|
}
|
2805
1953
|
});
|
2806
1954
|
var require_output_file = (0, import_chunk_AH6QHEOA.__commonJS)({
|
2807
|
-
"../../node_modules/.pnpm/fs-extra@11.
|
1955
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/output-file/index.js"(exports, module2) {
|
2808
1956
|
"use strict";
|
2809
|
-
var u = require_universalify().
|
2810
|
-
var fs4 =
|
1957
|
+
var u = require_universalify().fromPromise;
|
1958
|
+
var fs4 = require_fs();
|
2811
1959
|
var path6 = (0, import_chunk_AH6QHEOA.__require)("path");
|
2812
1960
|
var mkdir = require_mkdirs();
|
2813
1961
|
var pathExists2 = require_path_exists().pathExists;
|
2814
|
-
function outputFile(file, data, encoding
|
2815
|
-
if (typeof encoding === "function") {
|
2816
|
-
callback = encoding;
|
2817
|
-
encoding = "utf8";
|
2818
|
-
}
|
1962
|
+
async function outputFile(file, data, encoding = "utf-8") {
|
2819
1963
|
const dir = path6.dirname(file);
|
2820
|
-
pathExists2(dir
|
2821
|
-
|
2822
|
-
|
2823
|
-
|
2824
|
-
if (err2) return callback(err2);
|
2825
|
-
fs4.writeFile(file, data, encoding, callback);
|
2826
|
-
});
|
2827
|
-
});
|
1964
|
+
if (!await pathExists2(dir)) {
|
1965
|
+
await mkdir.mkdirs(dir);
|
1966
|
+
}
|
1967
|
+
return fs4.writeFile(file, data, encoding);
|
2828
1968
|
}
|
2829
1969
|
function outputFileSync(file, ...args) {
|
2830
1970
|
const dir = path6.dirname(file);
|
2831
|
-
if (fs4.existsSync(dir)) {
|
2832
|
-
|
1971
|
+
if (!fs4.existsSync(dir)) {
|
1972
|
+
mkdir.mkdirsSync(dir);
|
2833
1973
|
}
|
2834
|
-
mkdir.mkdirsSync(dir);
|
2835
1974
|
fs4.writeFileSync(file, ...args);
|
2836
1975
|
}
|
2837
1976
|
module2.exports = {
|
@@ -2841,7 +1980,7 @@ var require_output_file = (0, import_chunk_AH6QHEOA.__commonJS)({
|
|
2841
1980
|
}
|
2842
1981
|
});
|
2843
1982
|
var require_output_json = (0, import_chunk_AH6QHEOA.__commonJS)({
|
2844
|
-
"../../node_modules/.pnpm/fs-extra@11.
|
1983
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/json/output-json.js"(exports, module2) {
|
2845
1984
|
"use strict";
|
2846
1985
|
var { stringify } = require_utils2();
|
2847
1986
|
var { outputFile } = require_output_file();
|
@@ -2853,7 +1992,7 @@ var require_output_json = (0, import_chunk_AH6QHEOA.__commonJS)({
|
|
2853
1992
|
}
|
2854
1993
|
});
|
2855
1994
|
var require_output_json_sync = (0, import_chunk_AH6QHEOA.__commonJS)({
|
2856
|
-
"../../node_modules/.pnpm/fs-extra@11.
|
1995
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/json/output-json-sync.js"(exports, module2) {
|
2857
1996
|
"use strict";
|
2858
1997
|
var { stringify } = require_utils2();
|
2859
1998
|
var { outputFileSync } = require_output_file();
|
@@ -2865,7 +2004,7 @@ var require_output_json_sync = (0, import_chunk_AH6QHEOA.__commonJS)({
|
|
2865
2004
|
}
|
2866
2005
|
});
|
2867
2006
|
var require_json = (0, import_chunk_AH6QHEOA.__commonJS)({
|
2868
|
-
"../../node_modules/.pnpm/fs-extra@11.
|
2007
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/json/index.js"(exports, module2) {
|
2869
2008
|
"use strict";
|
2870
2009
|
var u = require_universalify().fromPromise;
|
2871
2010
|
var jsonFile = require_jsonfile2();
|
@@ -2881,77 +2020,57 @@ var require_json = (0, import_chunk_AH6QHEOA.__commonJS)({
|
|
2881
2020
|
}
|
2882
2021
|
});
|
2883
2022
|
var require_move = (0, import_chunk_AH6QHEOA.__commonJS)({
|
2884
|
-
"../../node_modules/.pnpm/fs-extra@11.
|
2023
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/move/move.js"(exports, module2) {
|
2885
2024
|
"use strict";
|
2886
|
-
var fs4 =
|
2025
|
+
var fs4 = require_fs();
|
2887
2026
|
var path6 = (0, import_chunk_AH6QHEOA.__require)("path");
|
2888
|
-
var copy = require_copy2()
|
2889
|
-
var remove = require_remove()
|
2890
|
-
var mkdirp = require_mkdirs()
|
2891
|
-
var pathExists2 = require_path_exists()
|
2027
|
+
var { copy } = require_copy2();
|
2028
|
+
var { remove } = require_remove();
|
2029
|
+
var { mkdirp } = require_mkdirs();
|
2030
|
+
var { pathExists: pathExists2 } = require_path_exists();
|
2892
2031
|
var stat = require_stat();
|
2893
|
-
function move(src, dest, opts
|
2894
|
-
if (typeof opts === "function") {
|
2895
|
-
cb = opts;
|
2896
|
-
opts = {};
|
2897
|
-
}
|
2898
|
-
opts = opts || {};
|
2032
|
+
async function move(src, dest, opts = {}) {
|
2899
2033
|
const overwrite = opts.overwrite || opts.clobber || false;
|
2900
|
-
stat.checkPaths(src, dest, "move", opts
|
2901
|
-
|
2902
|
-
|
2903
|
-
|
2904
|
-
|
2905
|
-
|
2906
|
-
mkdirp(path6.dirname(dest), (err3) => {
|
2907
|
-
if (err3) return cb(err3);
|
2908
|
-
return doRename(src, dest, overwrite, isChangingCase, cb);
|
2909
|
-
});
|
2910
|
-
});
|
2911
|
-
});
|
2912
|
-
}
|
2913
|
-
function isParentRoot(dest) {
|
2914
|
-
const parent = path6.dirname(dest);
|
2915
|
-
const parsedPath = path6.parse(parent);
|
2916
|
-
return parsedPath.root === parent;
|
2917
|
-
}
|
2918
|
-
function doRename(src, dest, overwrite, isChangingCase, cb) {
|
2919
|
-
if (isChangingCase) return rename(src, dest, overwrite, cb);
|
2920
|
-
if (overwrite) {
|
2921
|
-
return remove(dest, (err) => {
|
2922
|
-
if (err) return cb(err);
|
2923
|
-
return rename(src, dest, overwrite, cb);
|
2924
|
-
});
|
2034
|
+
const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, "move", opts);
|
2035
|
+
await stat.checkParentPaths(src, srcStat, dest, "move");
|
2036
|
+
const destParent = path6.dirname(dest);
|
2037
|
+
const parsedParentPath = path6.parse(destParent);
|
2038
|
+
if (parsedParentPath.root !== destParent) {
|
2039
|
+
await mkdirp(destParent);
|
2925
2040
|
}
|
2926
|
-
|
2927
|
-
if (err) return cb(err);
|
2928
|
-
if (destExists) return cb(new Error("dest already exists."));
|
2929
|
-
return rename(src, dest, overwrite, cb);
|
2930
|
-
});
|
2041
|
+
return doRename(src, dest, overwrite, isChangingCase);
|
2931
2042
|
}
|
2932
|
-
function
|
2933
|
-
|
2934
|
-
if (
|
2935
|
-
|
2936
|
-
|
2937
|
-
|
2043
|
+
async function doRename(src, dest, overwrite, isChangingCase) {
|
2044
|
+
if (!isChangingCase) {
|
2045
|
+
if (overwrite) {
|
2046
|
+
await remove(dest);
|
2047
|
+
} else if (await pathExists2(dest)) {
|
2048
|
+
throw new Error("dest already exists.");
|
2049
|
+
}
|
2050
|
+
}
|
2051
|
+
try {
|
2052
|
+
await fs4.rename(src, dest);
|
2053
|
+
} catch (err) {
|
2054
|
+
if (err.code !== "EXDEV") {
|
2055
|
+
throw err;
|
2056
|
+
}
|
2057
|
+
await moveAcrossDevice(src, dest, overwrite);
|
2058
|
+
}
|
2938
2059
|
}
|
2939
|
-
function moveAcrossDevice(src, dest, overwrite
|
2060
|
+
async function moveAcrossDevice(src, dest, overwrite) {
|
2940
2061
|
const opts = {
|
2941
2062
|
overwrite,
|
2942
2063
|
errorOnExist: true,
|
2943
2064
|
preserveTimestamps: true
|
2944
2065
|
};
|
2945
|
-
copy(src, dest, opts
|
2946
|
-
|
2947
|
-
return remove(src, cb);
|
2948
|
-
});
|
2066
|
+
await copy(src, dest, opts);
|
2067
|
+
return remove(src);
|
2949
2068
|
}
|
2950
2069
|
module2.exports = move;
|
2951
2070
|
}
|
2952
2071
|
});
|
2953
2072
|
var require_move_sync = (0, import_chunk_AH6QHEOA.__commonJS)({
|
2954
|
-
"../../node_modules/.pnpm/fs-extra@11.
|
2073
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/move/move-sync.js"(exports, module2) {
|
2955
2074
|
"use strict";
|
2956
2075
|
var fs4 = require_graceful_fs();
|
2957
2076
|
var path6 = (0, import_chunk_AH6QHEOA.__require)("path");
|
@@ -3002,9 +2121,9 @@ var require_move_sync = (0, import_chunk_AH6QHEOA.__commonJS)({
|
|
3002
2121
|
}
|
3003
2122
|
});
|
3004
2123
|
var require_move2 = (0, import_chunk_AH6QHEOA.__commonJS)({
|
3005
|
-
"../../node_modules/.pnpm/fs-extra@11.
|
2124
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/move/index.js"(exports, module2) {
|
3006
2125
|
"use strict";
|
3007
|
-
var u = require_universalify().
|
2126
|
+
var u = require_universalify().fromPromise;
|
3008
2127
|
module2.exports = {
|
3009
2128
|
move: u(require_move()),
|
3010
2129
|
moveSync: require_move_sync()
|
@@ -3012,7 +2131,7 @@ var require_move2 = (0, import_chunk_AH6QHEOA.__commonJS)({
|
|
3012
2131
|
}
|
3013
2132
|
});
|
3014
2133
|
var require_lib = (0, import_chunk_AH6QHEOA.__commonJS)({
|
3015
|
-
"../../node_modules/.pnpm/fs-extra@11.
|
2134
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/index.js"(exports, module2) {
|
3016
2135
|
"use strict";
|
3017
2136
|
module2.exports = {
|
3018
2137
|
// Export promiseified graceful-fs:
|
@@ -3213,7 +2332,7 @@ async function overwriteFile(sourcePath, targetPath) {
|
|
3213
2332
|
await removeFileIfExists(targetPath);
|
3214
2333
|
await import_fs.default.promises.copyFile(sourcePath, targetPath);
|
3215
2334
|
} else {
|
3216
|
-
|
2335
|
+
const tempPath = `${targetPath}.tmp${process.pid}`;
|
3217
2336
|
await import_fs.default.promises.copyFile(sourcePath, tempPath);
|
3218
2337
|
await import_fs.default.promises.rename(tempPath, targetPath);
|
3219
2338
|
}
|