vercel 59.11.2 → 59.11.7
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/chunks/{add-BKSHWTPX.js → add-KSJQYR5C.js} +23 -18
- package/dist/chunks/{add-RBW7QITR.js → add-PERLOALD.js} +37 -23
- package/dist/chunks/{add-HPLJZFM2.js → add-WU2QYHYL.js} +23 -18
- package/dist/chunks/{build-V4ZLAJWB.js → build-F3J6FLPD.js} +23 -18
- package/dist/chunks/{chunk-NGGLYKNU.js → chunk-26CU4Q3C.js} +3 -115
- package/dist/chunks/{chunk-QFAS4OVW.js → chunk-2JIX6UMI.js} +3 -84
- package/dist/chunks/chunk-2TSBB22D.js +14059 -0
- package/dist/chunks/chunk-332LMJLZ.js +16014 -0
- package/dist/chunks/{chunk-AYLY3ZVL.js → chunk-3VM7HWF6.js} +2 -2
- package/dist/chunks/chunk-4IALDGB7.js +22 -0
- package/dist/chunks/chunk-4IVSM24H.js +522 -0
- package/dist/chunks/{chunk-5XECIWME.js → chunk-5NF5HOBJ.js} +5 -3
- package/dist/chunks/chunk-6E6KPBXY.js +43 -0
- package/dist/chunks/chunk-7KROIXQM.js +59 -0
- package/dist/chunks/{chunk-ASBP32T6.js → chunk-7MRDIPJY.js} +1 -1
- package/dist/chunks/chunk-A5JZS6ZN.js +92 -0
- package/dist/chunks/{chunk-7ST552E3.js → chunk-AKLTIZCU.js} +1 -1
- package/dist/chunks/{chunk-26XDDLXM.js → chunk-ARU7VBKR.js} +2 -2
- package/dist/chunks/chunk-B5XLQKHI.js +849 -0
- package/dist/chunks/chunk-C762AAVU.js +137 -0
- package/dist/chunks/{chunk-WA2SJE5S.js → chunk-CEDN47PH.js} +4 -4
- package/dist/chunks/{chunk-ONRLTUP2.js → chunk-CNDPIHY5.js} +24 -22
- package/dist/chunks/{chunk-BMKU5KEL.js → chunk-CV5YC2EN.js} +1 -1
- package/dist/chunks/chunk-DBYHS3CK.js +257 -0
- package/dist/chunks/{chunk-HDBQPBL6.js → chunk-DSTNNQVV.js} +12 -8
- package/dist/chunks/{chunk-QAT3CW4G.js → chunk-EFYMIIER.js} +2 -2
- package/dist/chunks/{chunk-NBW3BWOJ.js → chunk-EPOLDWRA.js} +2 -2
- package/dist/chunks/{chunk-B4TXCKXE.js → chunk-EZQDYIVB.js} +10 -8
- package/dist/chunks/{chunk-2EAIC3SH.js → chunk-FL4JLNT2.js} +8 -8
- package/dist/chunks/chunk-FRVG4OW3.js +7438 -0
- package/dist/chunks/{chunk-FKDO3CM4.js → chunk-FVNJTRCE.js} +17 -13
- package/dist/chunks/chunk-FVT74RZ5.js +1536 -0
- package/dist/chunks/chunk-G3PXSXIB.js +18188 -0
- package/dist/chunks/chunk-G5FBSUL4.js +822 -0
- package/dist/chunks/{chunk-FRAXI2WT.js → chunk-GCVXKRR5.js} +3 -3
- package/dist/chunks/chunk-GHKJAK5V.js +1288 -0
- package/dist/chunks/{chunk-Q5K5DEOK.js → chunk-GUU4Z2AQ.js} +42 -28
- package/dist/chunks/{chunk-OQ3C5VXZ.js → chunk-GVNCVKCI.js} +4 -2
- package/dist/chunks/chunk-HB4UKFDO.js +1295 -0
- package/dist/chunks/chunk-HRXRELD3.js +338 -0
- package/dist/chunks/{chunk-IJ4X426J.js → chunk-IIMSID24.js} +1 -1
- package/dist/chunks/{chunk-O75LSD3C.js → chunk-JSD4EZL3.js} +1 -1
- package/dist/chunks/{chunk-7AEEQOD4.js → chunk-K3RED3VO.js} +1 -1
- package/dist/chunks/{chunk-RSEAADCE.js → chunk-KEKR7OCB.js} +6 -4
- package/dist/chunks/{chunk-3T7WSWZH.js → chunk-KFWQ3EFH.js} +1 -1
- package/dist/chunks/{chunk-L3UXB2CW.js → chunk-KW7BS25T.js} +1 -1
- package/dist/chunks/{chunk-RO44KX6Y.js → chunk-N4QHMXOO.js} +11 -7
- package/dist/chunks/{chunk-XRWOTCDO.js → chunk-ND5CF2H3.js} +1 -1
- package/dist/chunks/{chunk-RSJBU3ON.js → chunk-NSOYO6JQ.js} +35 -27
- package/dist/chunks/{chunk-RKDCNQ4S.js → chunk-NW34PW6V.js} +3 -105
- package/dist/chunks/{chunk-C5HKWXRR.js → chunk-OAMU5QO6.js} +1 -1
- package/dist/chunks/{chunk-MTWHQEXI.js → chunk-OIH6FP5Y.js} +5 -3
- package/dist/chunks/chunk-P7VSBDR4.js +827 -0
- package/dist/chunks/chunk-PEC3CQSK.js +90 -0
- package/dist/chunks/{chunk-QDV5LZ4Q.js → chunk-PFM75KY3.js} +12 -8
- package/dist/chunks/chunk-PJXMXMCO.js +81 -0
- package/dist/chunks/chunk-PNGVSHR3.js +40 -0
- package/dist/chunks/{chunk-TPATD2MM.js → chunk-QHS645AZ.js} +14 -6
- package/dist/chunks/{chunk-OTXE7MHI.js → chunk-QKX7WKIN.js} +8 -6
- package/dist/chunks/chunk-QOPTXV4G.js +417 -0
- package/dist/chunks/chunk-RN6V5ODW.js +114 -0
- package/dist/chunks/chunk-RVBZ64EQ.js +52 -0
- package/dist/chunks/chunk-SHFNEZVI.js +49 -0
- package/dist/chunks/{chunk-OO3OF6MK.js → chunk-TGNEG57M.js} +44 -15
- package/dist/chunks/{chunk-WNAKOXGK.js → chunk-TO7QZGYK.js} +1 -1
- package/dist/chunks/chunk-UARGTFCT.js +875 -0
- package/dist/chunks/{chunk-FWKSJYDV.js → chunk-UG2WOB5L.js} +1 -1
- package/dist/chunks/chunk-V4RMJKQP.js +36 -0
- package/dist/chunks/chunk-VT3Z7HF6.js +233 -0
- package/dist/chunks/chunk-VUS2JQB2.js +121 -0
- package/dist/chunks/{chunk-6CZZ3SH3.js → chunk-VYC45Q4Z.js} +2 -2
- package/dist/chunks/{chunk-4KVJ2M4J.js → chunk-WL6QYSGD.js} +78 -17
- package/dist/chunks/{chunk-FZRBF25Y.js → chunk-X7DBBZQD.js} +4 -4
- package/dist/chunks/{chunk-2NJJ2K5S.js → chunk-XD4DCYMX.js} +6 -6
- package/dist/chunks/{chunk-ZSFEACZU.js → chunk-XFF5TGRA.js} +1 -1
- package/dist/chunks/{chunk-6TBDHUXK.js → chunk-XIFATBH5.js} +21 -15
- package/dist/chunks/chunk-XNIZGCN5.js +58 -0
- package/dist/chunks/chunk-XPJLPUKO.js +117 -0
- package/dist/chunks/{chunk-FXD67VN5.js → chunk-XUAWTW4W.js} +1 -1
- package/dist/chunks/{chunk-I526H4AS.js → chunk-YS76T533.js} +2 -2
- package/dist/chunks/chunk-Z7JWYFOY.js +58 -0
- package/dist/chunks/{chunk-6JPVTPTU.js → chunk-ZBEECGFD.js} +3 -3
- package/dist/chunks/{chunk-52QYYTM5.js → chunk-ZDU2NODC.js} +3 -127
- package/dist/chunks/chunk-ZW6HETRE.js +97 -0
- package/dist/chunks/{clear-IYGWCNXT.js → clear-XUQO4ZTK.js} +23 -18
- package/dist/chunks/{compile-vercel-config-NEEBZRUJ.js → compile-vercel-config-D3ARNHTN.js} +8 -11
- package/dist/chunks/{config-6DS6BBR2.js → config-37OAE7QJ.js} +22 -17
- package/dist/chunks/{config-NTB5EMV4.js → config-MEDLXUVM.js} +23 -18
- package/dist/chunks/{delete-LLC2OGHA.js → delete-3N3YZZOF.js} +16 -12
- package/dist/chunks/{delete-LSGID5FV.js → delete-VSWDZ2SW.js} +19 -14
- package/dist/chunks/detect-projects-ODNU4PK2.js +18 -0
- package/dist/chunks/detect-services-TESZCQWG.js +40 -0
- package/dist/chunks/{disable-H4EXEQK7.js → disable-A4FLFMC7.js} +17 -13
- package/dist/chunks/{discard-FG6VKHWN.js → discard-CHGFULBZ.js} +17 -13
- package/dist/chunks/{edit-YE7D3CPJ.js → edit-JZ63AJYQ.js} +17 -13
- package/dist/chunks/{edit-BZJSGUHT.js → edit-MHSYAPDR.js} +19 -15
- package/dist/chunks/{enable-6ESD4QTE.js → enable-KD46SEC5.js} +17 -13
- package/dist/chunks/{exec-XH4K34JM.js → exec-4IPHZ55G.js} +9 -5
- package/dist/chunks/{export-QWSJROLG.js → export-42QZLBSN.js} +16 -13
- package/dist/chunks/{image-LTHQMKFG.js → image-GP4H73A2.js} +11 -8
- package/dist/chunks/{import-builders-6O7ILGQJ.js → import-builders-6TBLMPL2.js} +18 -13
- package/dist/chunks/{inspect-2C4ZSNYC.js → inspect-5FMWMY3C.js} +22 -18
- package/dist/chunks/{inspect-N6SMHV3Z.js → inspect-MUVK6MMT.js} +18 -14
- package/dist/chunks/{inspect-F7KCTHIL.js → inspect-Q3DWW7MC.js} +22 -18
- package/dist/chunks/{inspect-TWDPMXZ5.js → inspect-QFXAOUL4.js} +18 -14
- package/dist/chunks/{inspect-ICKNCDMT.js → inspect-RNTSYM6O.js} +18 -14
- package/dist/chunks/{list-NWTIJF3L.js → list-IHHIPXEC.js} +20 -16
- package/dist/chunks/{list-IPGQVBJO.js → list-JRNWLSO5.js} +16 -14
- package/dist/chunks/{list-DS7ZOUXA.js → list-XHD5DLEX.js} +23 -19
- package/dist/chunks/{login-F7A7ONKC.js → login-PCT6KFWY.js} +23 -18
- package/dist/chunks/{ls-NBDX3MKN.js → ls-GPEHEFCF.js} +24 -18
- package/dist/chunks/{ls-RNGO257R.js → ls-PF7F4PP4.js} +27 -23
- package/dist/chunks/{ls-XINES6PL.js → ls-PQZ2RIDX.js} +24 -18
- package/dist/chunks/{ls-D4TUDBIH.js → ls-SVOHC3XW.js} +24 -18
- package/dist/chunks/{ls-2QW3ZSM6.js → ls-TGHCCARZ.js} +24 -18
- package/dist/chunks/{ls-LSJEUPFX.js → ls-VRIH5WA3.js} +22 -15
- package/dist/chunks/{open-VRQDWZAW.js → open-E7DEKYDU.js} +18 -13
- package/dist/chunks/{permissions-6C5C7TEV.js → permissions-JKOONWVL.js} +14 -11
- package/dist/chunks/{publish-GVIZPNLN.js → publish-EDDELDE5.js} +17 -13
- package/dist/chunks/pull-646WEVDE.js +45 -0
- package/dist/chunks/{push-EFZ5P5Z6.js → push-LTNW5OVD.js} +23 -18
- package/dist/chunks/{query-GBS2PIT4.js → query-LU4N6KPO.js} +22 -19
- package/dist/chunks/{reorder-TN65IFRL.js → reorder-22PKJMZP.js} +17 -13
- package/dist/chunks/{reply-DYVEV3PY.js → reply-SF2EZMVZ.js} +17 -13
- package/dist/chunks/{resolve-JAWFBPUM.js → resolve-ZCZGXTOT.js} +16 -12
- package/dist/chunks/resolve-deployment-framework-preset-NPE6RLV3.js +36 -0
- package/dist/chunks/{restore-TJVMHUBQ.js → restore-VJAWZXB4.js} +17 -13
- package/dist/chunks/{rm-7XACNZ2U.js → rm-KN2QFCKO.js} +23 -18
- package/dist/chunks/{rm-REJVXALW.js → rm-KVEAJPRE.js} +23 -18
- package/dist/chunks/{rm-CBPNMSRP.js → rm-OSZ5FZUM.js} +23 -16
- package/dist/chunks/{rm-5B5VHWWN.js → rm-W722Q2AO.js} +21 -18
- package/dist/chunks/{rm-HQ5CYNJA.js → rm-WNPGTUBH.js} +23 -18
- package/dist/chunks/{routes-2OLIBRYX.js → routes-QVMBXOSX.js} +7 -3
- package/dist/chunks/{rule-inspect-ZSTDDFID.js → rule-inspect-25Z6SNX3.js} +28 -24
- package/dist/chunks/{rules-VGV4M4KY.js → rules-65LKAQ35.js} +15 -12
- package/dist/chunks/{schema-45SJNY5L.js → schema-7D6IGJEJ.js} +9 -7
- package/dist/chunks/{schema-GMTQOQCV.js → schema-NXCW4M75.js} +19 -17
- package/dist/chunks/{set-Z5FO2FCC.js → set-FYJVKMPV.js} +20 -13
- package/dist/chunks/setup-and-link-KXPZE32P.js +65 -0
- package/dist/chunks/{tags-SDRXWJ63.js → tags-ANIRP5E3.js} +10 -7
- package/dist/chunks/{types-JGANJ5EQ.js → types-4GAJ7XQQ.js} +9 -7
- package/dist/chunks/{update-JBQBC3IV.js → update-UT6CTKVG.js} +32 -19
- package/dist/commands/build/index.js +86 -49
- package/dist/commands/deploy/index.js +75 -66
- package/dist/commands/dev/index.js +98 -52
- package/dist/commands/env/index.js +67 -43
- package/dist/commands/link/index.js +48 -27
- package/dist/commands/list/index.js +33 -22
- package/dist/commands-bulk.js +1659 -1287
- package/dist/index.js +62 -40
- package/dist/version.mjs +1 -1
- package/package.json +46 -46
- package/dist/chunks/chunk-WYU64FLP.js +0 -62123
- package/dist/chunks/chunk-XNFHNTS2.js +0 -2939
|
@@ -0,0 +1,822 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import {
|
|
8
|
+
__commonJS,
|
|
9
|
+
__require
|
|
10
|
+
} from "./chunk-TZ2YI2VH.js";
|
|
11
|
+
|
|
12
|
+
// ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js
|
|
13
|
+
var require_polyfills = __commonJS({
|
|
14
|
+
"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js"(exports, module) {
|
|
15
|
+
var constants = __require("constants");
|
|
16
|
+
var origCwd = process.cwd;
|
|
17
|
+
var cwd = null;
|
|
18
|
+
var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform;
|
|
19
|
+
process.cwd = function() {
|
|
20
|
+
if (!cwd)
|
|
21
|
+
cwd = origCwd.call(process);
|
|
22
|
+
return cwd;
|
|
23
|
+
};
|
|
24
|
+
try {
|
|
25
|
+
process.cwd();
|
|
26
|
+
} catch (er) {
|
|
27
|
+
}
|
|
28
|
+
if (typeof process.chdir === "function") {
|
|
29
|
+
chdir = process.chdir;
|
|
30
|
+
process.chdir = function(d) {
|
|
31
|
+
cwd = null;
|
|
32
|
+
chdir.call(process, d);
|
|
33
|
+
};
|
|
34
|
+
if (Object.setPrototypeOf)
|
|
35
|
+
Object.setPrototypeOf(process.chdir, chdir);
|
|
36
|
+
}
|
|
37
|
+
var chdir;
|
|
38
|
+
module.exports = patch;
|
|
39
|
+
function patch(fs) {
|
|
40
|
+
if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
|
|
41
|
+
patchLchmod(fs);
|
|
42
|
+
}
|
|
43
|
+
if (!fs.lutimes) {
|
|
44
|
+
patchLutimes(fs);
|
|
45
|
+
}
|
|
46
|
+
fs.chown = chownFix(fs.chown);
|
|
47
|
+
fs.fchown = chownFix(fs.fchown);
|
|
48
|
+
fs.lchown = chownFix(fs.lchown);
|
|
49
|
+
fs.chmod = chmodFix(fs.chmod);
|
|
50
|
+
fs.fchmod = chmodFix(fs.fchmod);
|
|
51
|
+
fs.lchmod = chmodFix(fs.lchmod);
|
|
52
|
+
fs.chownSync = chownFixSync(fs.chownSync);
|
|
53
|
+
fs.fchownSync = chownFixSync(fs.fchownSync);
|
|
54
|
+
fs.lchownSync = chownFixSync(fs.lchownSync);
|
|
55
|
+
fs.chmodSync = chmodFixSync(fs.chmodSync);
|
|
56
|
+
fs.fchmodSync = chmodFixSync(fs.fchmodSync);
|
|
57
|
+
fs.lchmodSync = chmodFixSync(fs.lchmodSync);
|
|
58
|
+
fs.stat = statFix(fs.stat);
|
|
59
|
+
fs.fstat = statFix(fs.fstat);
|
|
60
|
+
fs.lstat = statFix(fs.lstat);
|
|
61
|
+
fs.statSync = statFixSync(fs.statSync);
|
|
62
|
+
fs.fstatSync = statFixSync(fs.fstatSync);
|
|
63
|
+
fs.lstatSync = statFixSync(fs.lstatSync);
|
|
64
|
+
if (fs.chmod && !fs.lchmod) {
|
|
65
|
+
fs.lchmod = function(path, mode, cb) {
|
|
66
|
+
if (cb)
|
|
67
|
+
process.nextTick(cb);
|
|
68
|
+
};
|
|
69
|
+
fs.lchmodSync = function() {
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
if (fs.chown && !fs.lchown) {
|
|
73
|
+
fs.lchown = function(path, uid, gid, cb) {
|
|
74
|
+
if (cb)
|
|
75
|
+
process.nextTick(cb);
|
|
76
|
+
};
|
|
77
|
+
fs.lchownSync = function() {
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
if (platform === "win32") {
|
|
81
|
+
fs.rename = typeof fs.rename !== "function" ? fs.rename : function(fs$rename) {
|
|
82
|
+
function rename(from, to, cb) {
|
|
83
|
+
var start = Date.now();
|
|
84
|
+
var backoff = 0;
|
|
85
|
+
fs$rename(from, to, function CB(er) {
|
|
86
|
+
if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
|
|
87
|
+
setTimeout(function() {
|
|
88
|
+
fs.stat(to, function(stater, st) {
|
|
89
|
+
if (stater && stater.code === "ENOENT")
|
|
90
|
+
fs$rename(from, to, CB);
|
|
91
|
+
else
|
|
92
|
+
cb(er);
|
|
93
|
+
});
|
|
94
|
+
}, backoff);
|
|
95
|
+
if (backoff < 100)
|
|
96
|
+
backoff += 10;
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
if (cb)
|
|
100
|
+
cb(er);
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
if (Object.setPrototypeOf)
|
|
104
|
+
Object.setPrototypeOf(rename, fs$rename);
|
|
105
|
+
return rename;
|
|
106
|
+
}(fs.rename);
|
|
107
|
+
}
|
|
108
|
+
fs.read = typeof fs.read !== "function" ? fs.read : function(fs$read) {
|
|
109
|
+
function read(fd, buffer, offset, length, position, callback_) {
|
|
110
|
+
var callback;
|
|
111
|
+
if (callback_ && typeof callback_ === "function") {
|
|
112
|
+
var eagCounter = 0;
|
|
113
|
+
callback = function(er, _, __) {
|
|
114
|
+
if (er && er.code === "EAGAIN" && eagCounter < 10) {
|
|
115
|
+
eagCounter++;
|
|
116
|
+
return fs$read.call(fs, fd, buffer, offset, length, position, callback);
|
|
117
|
+
}
|
|
118
|
+
callback_.apply(this, arguments);
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
return fs$read.call(fs, fd, buffer, offset, length, position, callback);
|
|
122
|
+
}
|
|
123
|
+
if (Object.setPrototypeOf)
|
|
124
|
+
Object.setPrototypeOf(read, fs$read);
|
|
125
|
+
return read;
|
|
126
|
+
}(fs.read);
|
|
127
|
+
fs.readSync = typeof fs.readSync !== "function" ? fs.readSync : function(fs$readSync) {
|
|
128
|
+
return function(fd, buffer, offset, length, position) {
|
|
129
|
+
var eagCounter = 0;
|
|
130
|
+
while (true) {
|
|
131
|
+
try {
|
|
132
|
+
return fs$readSync.call(fs, fd, buffer, offset, length, position);
|
|
133
|
+
} catch (er) {
|
|
134
|
+
if (er.code === "EAGAIN" && eagCounter < 10) {
|
|
135
|
+
eagCounter++;
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
throw er;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
}(fs.readSync);
|
|
143
|
+
function patchLchmod(fs2) {
|
|
144
|
+
fs2.lchmod = function(path, mode, callback) {
|
|
145
|
+
fs2.open(
|
|
146
|
+
path,
|
|
147
|
+
constants.O_WRONLY | constants.O_SYMLINK,
|
|
148
|
+
mode,
|
|
149
|
+
function(err, fd) {
|
|
150
|
+
if (err) {
|
|
151
|
+
if (callback)
|
|
152
|
+
callback(err);
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
fs2.fchmod(fd, mode, function(err2) {
|
|
156
|
+
fs2.close(fd, function(err22) {
|
|
157
|
+
if (callback)
|
|
158
|
+
callback(err2 || err22);
|
|
159
|
+
});
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
);
|
|
163
|
+
};
|
|
164
|
+
fs2.lchmodSync = function(path, mode) {
|
|
165
|
+
var fd = fs2.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode);
|
|
166
|
+
var threw = true;
|
|
167
|
+
var ret;
|
|
168
|
+
try {
|
|
169
|
+
ret = fs2.fchmodSync(fd, mode);
|
|
170
|
+
threw = false;
|
|
171
|
+
} finally {
|
|
172
|
+
if (threw) {
|
|
173
|
+
try {
|
|
174
|
+
fs2.closeSync(fd);
|
|
175
|
+
} catch (er) {
|
|
176
|
+
}
|
|
177
|
+
} else {
|
|
178
|
+
fs2.closeSync(fd);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
return ret;
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
function patchLutimes(fs2) {
|
|
185
|
+
if (constants.hasOwnProperty("O_SYMLINK") && fs2.futimes) {
|
|
186
|
+
fs2.lutimes = function(path, at, mt, cb) {
|
|
187
|
+
fs2.open(path, constants.O_SYMLINK, function(er, fd) {
|
|
188
|
+
if (er) {
|
|
189
|
+
if (cb)
|
|
190
|
+
cb(er);
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
fs2.futimes(fd, at, mt, function(er2) {
|
|
194
|
+
fs2.close(fd, function(er22) {
|
|
195
|
+
if (cb)
|
|
196
|
+
cb(er2 || er22);
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
});
|
|
200
|
+
};
|
|
201
|
+
fs2.lutimesSync = function(path, at, mt) {
|
|
202
|
+
var fd = fs2.openSync(path, constants.O_SYMLINK);
|
|
203
|
+
var ret;
|
|
204
|
+
var threw = true;
|
|
205
|
+
try {
|
|
206
|
+
ret = fs2.futimesSync(fd, at, mt);
|
|
207
|
+
threw = false;
|
|
208
|
+
} finally {
|
|
209
|
+
if (threw) {
|
|
210
|
+
try {
|
|
211
|
+
fs2.closeSync(fd);
|
|
212
|
+
} catch (er) {
|
|
213
|
+
}
|
|
214
|
+
} else {
|
|
215
|
+
fs2.closeSync(fd);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
return ret;
|
|
219
|
+
};
|
|
220
|
+
} else if (fs2.futimes) {
|
|
221
|
+
fs2.lutimes = function(_a, _b, _c, cb) {
|
|
222
|
+
if (cb)
|
|
223
|
+
process.nextTick(cb);
|
|
224
|
+
};
|
|
225
|
+
fs2.lutimesSync = function() {
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
function chmodFix(orig) {
|
|
230
|
+
if (!orig)
|
|
231
|
+
return orig;
|
|
232
|
+
return function(target, mode, cb) {
|
|
233
|
+
return orig.call(fs, target, mode, function(er) {
|
|
234
|
+
if (chownErOk(er))
|
|
235
|
+
er = null;
|
|
236
|
+
if (cb)
|
|
237
|
+
cb.apply(this, arguments);
|
|
238
|
+
});
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
function chmodFixSync(orig) {
|
|
242
|
+
if (!orig)
|
|
243
|
+
return orig;
|
|
244
|
+
return function(target, mode) {
|
|
245
|
+
try {
|
|
246
|
+
return orig.call(fs, target, mode);
|
|
247
|
+
} catch (er) {
|
|
248
|
+
if (!chownErOk(er))
|
|
249
|
+
throw er;
|
|
250
|
+
}
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
function chownFix(orig) {
|
|
254
|
+
if (!orig)
|
|
255
|
+
return orig;
|
|
256
|
+
return function(target, uid, gid, cb) {
|
|
257
|
+
return orig.call(fs, target, uid, gid, function(er) {
|
|
258
|
+
if (chownErOk(er))
|
|
259
|
+
er = null;
|
|
260
|
+
if (cb)
|
|
261
|
+
cb.apply(this, arguments);
|
|
262
|
+
});
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
function chownFixSync(orig) {
|
|
266
|
+
if (!orig)
|
|
267
|
+
return orig;
|
|
268
|
+
return function(target, uid, gid) {
|
|
269
|
+
try {
|
|
270
|
+
return orig.call(fs, target, uid, gid);
|
|
271
|
+
} catch (er) {
|
|
272
|
+
if (!chownErOk(er))
|
|
273
|
+
throw er;
|
|
274
|
+
}
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
function statFix(orig) {
|
|
278
|
+
if (!orig)
|
|
279
|
+
return orig;
|
|
280
|
+
return function(target, options, cb) {
|
|
281
|
+
if (typeof options === "function") {
|
|
282
|
+
cb = options;
|
|
283
|
+
options = null;
|
|
284
|
+
}
|
|
285
|
+
function callback(er, stats) {
|
|
286
|
+
if (stats) {
|
|
287
|
+
if (stats.uid < 0)
|
|
288
|
+
stats.uid += 4294967296;
|
|
289
|
+
if (stats.gid < 0)
|
|
290
|
+
stats.gid += 4294967296;
|
|
291
|
+
}
|
|
292
|
+
if (cb)
|
|
293
|
+
cb.apply(this, arguments);
|
|
294
|
+
}
|
|
295
|
+
return options ? orig.call(fs, target, options, callback) : orig.call(fs, target, callback);
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
function statFixSync(orig) {
|
|
299
|
+
if (!orig)
|
|
300
|
+
return orig;
|
|
301
|
+
return function(target, options) {
|
|
302
|
+
var stats = options ? orig.call(fs, target, options) : orig.call(fs, target);
|
|
303
|
+
if (stats) {
|
|
304
|
+
if (stats.uid < 0)
|
|
305
|
+
stats.uid += 4294967296;
|
|
306
|
+
if (stats.gid < 0)
|
|
307
|
+
stats.gid += 4294967296;
|
|
308
|
+
}
|
|
309
|
+
return stats;
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
function chownErOk(er) {
|
|
313
|
+
if (!er)
|
|
314
|
+
return true;
|
|
315
|
+
if (er.code === "ENOSYS")
|
|
316
|
+
return true;
|
|
317
|
+
var nonroot = !process.getuid || process.getuid() !== 0;
|
|
318
|
+
if (nonroot) {
|
|
319
|
+
if (er.code === "EINVAL" || er.code === "EPERM")
|
|
320
|
+
return true;
|
|
321
|
+
}
|
|
322
|
+
return false;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
});
|
|
327
|
+
|
|
328
|
+
// ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js
|
|
329
|
+
var require_legacy_streams = __commonJS({
|
|
330
|
+
"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js"(exports, module) {
|
|
331
|
+
var Stream = __require("stream").Stream;
|
|
332
|
+
module.exports = legacy;
|
|
333
|
+
function legacy(fs) {
|
|
334
|
+
return {
|
|
335
|
+
ReadStream,
|
|
336
|
+
WriteStream
|
|
337
|
+
};
|
|
338
|
+
function ReadStream(path, options) {
|
|
339
|
+
if (!(this instanceof ReadStream))
|
|
340
|
+
return new ReadStream(path, options);
|
|
341
|
+
Stream.call(this);
|
|
342
|
+
var self = this;
|
|
343
|
+
this.path = path;
|
|
344
|
+
this.fd = null;
|
|
345
|
+
this.readable = true;
|
|
346
|
+
this.paused = false;
|
|
347
|
+
this.flags = "r";
|
|
348
|
+
this.mode = 438;
|
|
349
|
+
this.bufferSize = 64 * 1024;
|
|
350
|
+
options = options || {};
|
|
351
|
+
var keys = Object.keys(options);
|
|
352
|
+
for (var index = 0, length = keys.length; index < length; index++) {
|
|
353
|
+
var key = keys[index];
|
|
354
|
+
this[key] = options[key];
|
|
355
|
+
}
|
|
356
|
+
if (this.encoding)
|
|
357
|
+
this.setEncoding(this.encoding);
|
|
358
|
+
if (this.start !== void 0) {
|
|
359
|
+
if ("number" !== typeof this.start) {
|
|
360
|
+
throw TypeError("start must be a Number");
|
|
361
|
+
}
|
|
362
|
+
if (this.end === void 0) {
|
|
363
|
+
this.end = Infinity;
|
|
364
|
+
} else if ("number" !== typeof this.end) {
|
|
365
|
+
throw TypeError("end must be a Number");
|
|
366
|
+
}
|
|
367
|
+
if (this.start > this.end) {
|
|
368
|
+
throw new Error("start must be <= end");
|
|
369
|
+
}
|
|
370
|
+
this.pos = this.start;
|
|
371
|
+
}
|
|
372
|
+
if (this.fd !== null) {
|
|
373
|
+
process.nextTick(function() {
|
|
374
|
+
self._read();
|
|
375
|
+
});
|
|
376
|
+
return;
|
|
377
|
+
}
|
|
378
|
+
fs.open(this.path, this.flags, this.mode, function(err, fd) {
|
|
379
|
+
if (err) {
|
|
380
|
+
self.emit("error", err);
|
|
381
|
+
self.readable = false;
|
|
382
|
+
return;
|
|
383
|
+
}
|
|
384
|
+
self.fd = fd;
|
|
385
|
+
self.emit("open", fd);
|
|
386
|
+
self._read();
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
function WriteStream(path, options) {
|
|
390
|
+
if (!(this instanceof WriteStream))
|
|
391
|
+
return new WriteStream(path, options);
|
|
392
|
+
Stream.call(this);
|
|
393
|
+
this.path = path;
|
|
394
|
+
this.fd = null;
|
|
395
|
+
this.writable = true;
|
|
396
|
+
this.flags = "w";
|
|
397
|
+
this.encoding = "binary";
|
|
398
|
+
this.mode = 438;
|
|
399
|
+
this.bytesWritten = 0;
|
|
400
|
+
options = options || {};
|
|
401
|
+
var keys = Object.keys(options);
|
|
402
|
+
for (var index = 0, length = keys.length; index < length; index++) {
|
|
403
|
+
var key = keys[index];
|
|
404
|
+
this[key] = options[key];
|
|
405
|
+
}
|
|
406
|
+
if (this.start !== void 0) {
|
|
407
|
+
if ("number" !== typeof this.start) {
|
|
408
|
+
throw TypeError("start must be a Number");
|
|
409
|
+
}
|
|
410
|
+
if (this.start < 0) {
|
|
411
|
+
throw new Error("start must be >= zero");
|
|
412
|
+
}
|
|
413
|
+
this.pos = this.start;
|
|
414
|
+
}
|
|
415
|
+
this.busy = false;
|
|
416
|
+
this._queue = [];
|
|
417
|
+
if (this.fd === null) {
|
|
418
|
+
this._open = fs.open;
|
|
419
|
+
this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
|
|
420
|
+
this.flush();
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
});
|
|
426
|
+
|
|
427
|
+
// ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/clone.js
|
|
428
|
+
var require_clone = __commonJS({
|
|
429
|
+
"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/clone.js"(exports, module) {
|
|
430
|
+
"use strict";
|
|
431
|
+
module.exports = clone;
|
|
432
|
+
var getPrototypeOf = Object.getPrototypeOf || function(obj) {
|
|
433
|
+
return obj.__proto__;
|
|
434
|
+
};
|
|
435
|
+
function clone(obj) {
|
|
436
|
+
if (obj === null || typeof obj !== "object")
|
|
437
|
+
return obj;
|
|
438
|
+
if (obj instanceof Object)
|
|
439
|
+
var copy = { __proto__: getPrototypeOf(obj) };
|
|
440
|
+
else
|
|
441
|
+
var copy = /* @__PURE__ */ Object.create(null);
|
|
442
|
+
Object.getOwnPropertyNames(obj).forEach(function(key) {
|
|
443
|
+
Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key));
|
|
444
|
+
});
|
|
445
|
+
return copy;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
});
|
|
449
|
+
|
|
450
|
+
// ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js
|
|
451
|
+
var require_graceful_fs = __commonJS({
|
|
452
|
+
"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js"(exports, module) {
|
|
453
|
+
var fs = __require("fs");
|
|
454
|
+
var polyfills = require_polyfills();
|
|
455
|
+
var legacy = require_legacy_streams();
|
|
456
|
+
var clone = require_clone();
|
|
457
|
+
var util = __require("util");
|
|
458
|
+
var gracefulQueue;
|
|
459
|
+
var previousSymbol;
|
|
460
|
+
if (typeof Symbol === "function" && typeof Symbol.for === "function") {
|
|
461
|
+
gracefulQueue = Symbol.for("graceful-fs.queue");
|
|
462
|
+
previousSymbol = Symbol.for("graceful-fs.previous");
|
|
463
|
+
} else {
|
|
464
|
+
gracefulQueue = "___graceful-fs.queue";
|
|
465
|
+
previousSymbol = "___graceful-fs.previous";
|
|
466
|
+
}
|
|
467
|
+
function noop() {
|
|
468
|
+
}
|
|
469
|
+
function publishQueue(context, queue2) {
|
|
470
|
+
Object.defineProperty(context, gracefulQueue, {
|
|
471
|
+
get: function() {
|
|
472
|
+
return queue2;
|
|
473
|
+
}
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
var debug = noop;
|
|
477
|
+
if (util.debuglog)
|
|
478
|
+
debug = util.debuglog("gfs4");
|
|
479
|
+
else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ""))
|
|
480
|
+
debug = function() {
|
|
481
|
+
var m = util.format.apply(util, arguments);
|
|
482
|
+
m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
|
|
483
|
+
console.error(m);
|
|
484
|
+
};
|
|
485
|
+
if (!fs[gracefulQueue]) {
|
|
486
|
+
queue = global[gracefulQueue] || [];
|
|
487
|
+
publishQueue(fs, queue);
|
|
488
|
+
fs.close = function(fs$close) {
|
|
489
|
+
function close(fd, cb) {
|
|
490
|
+
return fs$close.call(fs, fd, function(err) {
|
|
491
|
+
if (!err) {
|
|
492
|
+
resetQueue();
|
|
493
|
+
}
|
|
494
|
+
if (typeof cb === "function")
|
|
495
|
+
cb.apply(this, arguments);
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
Object.defineProperty(close, previousSymbol, {
|
|
499
|
+
value: fs$close
|
|
500
|
+
});
|
|
501
|
+
return close;
|
|
502
|
+
}(fs.close);
|
|
503
|
+
fs.closeSync = function(fs$closeSync) {
|
|
504
|
+
function closeSync(fd) {
|
|
505
|
+
fs$closeSync.apply(fs, arguments);
|
|
506
|
+
resetQueue();
|
|
507
|
+
}
|
|
508
|
+
Object.defineProperty(closeSync, previousSymbol, {
|
|
509
|
+
value: fs$closeSync
|
|
510
|
+
});
|
|
511
|
+
return closeSync;
|
|
512
|
+
}(fs.closeSync);
|
|
513
|
+
if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
|
|
514
|
+
process.on("exit", function() {
|
|
515
|
+
debug(fs[gracefulQueue]);
|
|
516
|
+
__require("assert").equal(fs[gracefulQueue].length, 0);
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
var queue;
|
|
521
|
+
if (!global[gracefulQueue]) {
|
|
522
|
+
publishQueue(global, fs[gracefulQueue]);
|
|
523
|
+
}
|
|
524
|
+
module.exports = patch(clone(fs));
|
|
525
|
+
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) {
|
|
526
|
+
module.exports = patch(fs);
|
|
527
|
+
fs.__patched = true;
|
|
528
|
+
}
|
|
529
|
+
function patch(fs2) {
|
|
530
|
+
polyfills(fs2);
|
|
531
|
+
fs2.gracefulify = patch;
|
|
532
|
+
fs2.createReadStream = createReadStream;
|
|
533
|
+
fs2.createWriteStream = createWriteStream;
|
|
534
|
+
var fs$readFile = fs2.readFile;
|
|
535
|
+
fs2.readFile = readFile;
|
|
536
|
+
function readFile(path, options, cb) {
|
|
537
|
+
if (typeof options === "function")
|
|
538
|
+
cb = options, options = null;
|
|
539
|
+
return go$readFile(path, options, cb);
|
|
540
|
+
function go$readFile(path2, options2, cb2, startTime) {
|
|
541
|
+
return fs$readFile(path2, options2, function(err) {
|
|
542
|
+
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
543
|
+
enqueue([go$readFile, [path2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
544
|
+
else {
|
|
545
|
+
if (typeof cb2 === "function")
|
|
546
|
+
cb2.apply(this, arguments);
|
|
547
|
+
}
|
|
548
|
+
});
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
var fs$writeFile = fs2.writeFile;
|
|
552
|
+
fs2.writeFile = writeFile;
|
|
553
|
+
function writeFile(path, data, options, cb) {
|
|
554
|
+
if (typeof options === "function")
|
|
555
|
+
cb = options, options = null;
|
|
556
|
+
return go$writeFile(path, data, options, cb);
|
|
557
|
+
function go$writeFile(path2, data2, options2, cb2, startTime) {
|
|
558
|
+
return fs$writeFile(path2, data2, options2, function(err) {
|
|
559
|
+
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
560
|
+
enqueue([go$writeFile, [path2, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
561
|
+
else {
|
|
562
|
+
if (typeof cb2 === "function")
|
|
563
|
+
cb2.apply(this, arguments);
|
|
564
|
+
}
|
|
565
|
+
});
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
var fs$appendFile = fs2.appendFile;
|
|
569
|
+
if (fs$appendFile)
|
|
570
|
+
fs2.appendFile = appendFile;
|
|
571
|
+
function appendFile(path, data, options, cb) {
|
|
572
|
+
if (typeof options === "function")
|
|
573
|
+
cb = options, options = null;
|
|
574
|
+
return go$appendFile(path, data, options, cb);
|
|
575
|
+
function go$appendFile(path2, data2, options2, cb2, startTime) {
|
|
576
|
+
return fs$appendFile(path2, data2, options2, function(err) {
|
|
577
|
+
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
578
|
+
enqueue([go$appendFile, [path2, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
579
|
+
else {
|
|
580
|
+
if (typeof cb2 === "function")
|
|
581
|
+
cb2.apply(this, arguments);
|
|
582
|
+
}
|
|
583
|
+
});
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
var fs$copyFile = fs2.copyFile;
|
|
587
|
+
if (fs$copyFile)
|
|
588
|
+
fs2.copyFile = copyFile;
|
|
589
|
+
function copyFile(src, dest, flags, cb) {
|
|
590
|
+
if (typeof flags === "function") {
|
|
591
|
+
cb = flags;
|
|
592
|
+
flags = 0;
|
|
593
|
+
}
|
|
594
|
+
return go$copyFile(src, dest, flags, cb);
|
|
595
|
+
function go$copyFile(src2, dest2, flags2, cb2, startTime) {
|
|
596
|
+
return fs$copyFile(src2, dest2, flags2, function(err) {
|
|
597
|
+
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
598
|
+
enqueue([go$copyFile, [src2, dest2, flags2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
599
|
+
else {
|
|
600
|
+
if (typeof cb2 === "function")
|
|
601
|
+
cb2.apply(this, arguments);
|
|
602
|
+
}
|
|
603
|
+
});
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
var fs$readdir = fs2.readdir;
|
|
607
|
+
fs2.readdir = readdir;
|
|
608
|
+
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
609
|
+
function readdir(path, options, cb) {
|
|
610
|
+
if (typeof options === "function")
|
|
611
|
+
cb = options, options = null;
|
|
612
|
+
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path2, options2, cb2, startTime) {
|
|
613
|
+
return fs$readdir(path2, fs$readdirCallback(
|
|
614
|
+
path2,
|
|
615
|
+
options2,
|
|
616
|
+
cb2,
|
|
617
|
+
startTime
|
|
618
|
+
));
|
|
619
|
+
} : function go$readdir2(path2, options2, cb2, startTime) {
|
|
620
|
+
return fs$readdir(path2, options2, fs$readdirCallback(
|
|
621
|
+
path2,
|
|
622
|
+
options2,
|
|
623
|
+
cb2,
|
|
624
|
+
startTime
|
|
625
|
+
));
|
|
626
|
+
};
|
|
627
|
+
return go$readdir(path, options, cb);
|
|
628
|
+
function fs$readdirCallback(path2, options2, cb2, startTime) {
|
|
629
|
+
return function(err, files) {
|
|
630
|
+
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
631
|
+
enqueue([
|
|
632
|
+
go$readdir,
|
|
633
|
+
[path2, options2, cb2],
|
|
634
|
+
err,
|
|
635
|
+
startTime || Date.now(),
|
|
636
|
+
Date.now()
|
|
637
|
+
]);
|
|
638
|
+
else {
|
|
639
|
+
if (files && files.sort)
|
|
640
|
+
files.sort();
|
|
641
|
+
if (typeof cb2 === "function")
|
|
642
|
+
cb2.call(this, err, files);
|
|
643
|
+
}
|
|
644
|
+
};
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
if (process.version.substr(0, 4) === "v0.8") {
|
|
648
|
+
var legStreams = legacy(fs2);
|
|
649
|
+
ReadStream = legStreams.ReadStream;
|
|
650
|
+
WriteStream = legStreams.WriteStream;
|
|
651
|
+
}
|
|
652
|
+
var fs$ReadStream = fs2.ReadStream;
|
|
653
|
+
if (fs$ReadStream) {
|
|
654
|
+
ReadStream.prototype = Object.create(fs$ReadStream.prototype);
|
|
655
|
+
ReadStream.prototype.open = ReadStream$open;
|
|
656
|
+
}
|
|
657
|
+
var fs$WriteStream = fs2.WriteStream;
|
|
658
|
+
if (fs$WriteStream) {
|
|
659
|
+
WriteStream.prototype = Object.create(fs$WriteStream.prototype);
|
|
660
|
+
WriteStream.prototype.open = WriteStream$open;
|
|
661
|
+
}
|
|
662
|
+
Object.defineProperty(fs2, "ReadStream", {
|
|
663
|
+
get: function() {
|
|
664
|
+
return ReadStream;
|
|
665
|
+
},
|
|
666
|
+
set: function(val) {
|
|
667
|
+
ReadStream = val;
|
|
668
|
+
},
|
|
669
|
+
enumerable: true,
|
|
670
|
+
configurable: true
|
|
671
|
+
});
|
|
672
|
+
Object.defineProperty(fs2, "WriteStream", {
|
|
673
|
+
get: function() {
|
|
674
|
+
return WriteStream;
|
|
675
|
+
},
|
|
676
|
+
set: function(val) {
|
|
677
|
+
WriteStream = val;
|
|
678
|
+
},
|
|
679
|
+
enumerable: true,
|
|
680
|
+
configurable: true
|
|
681
|
+
});
|
|
682
|
+
var FileReadStream = ReadStream;
|
|
683
|
+
Object.defineProperty(fs2, "FileReadStream", {
|
|
684
|
+
get: function() {
|
|
685
|
+
return FileReadStream;
|
|
686
|
+
},
|
|
687
|
+
set: function(val) {
|
|
688
|
+
FileReadStream = val;
|
|
689
|
+
},
|
|
690
|
+
enumerable: true,
|
|
691
|
+
configurable: true
|
|
692
|
+
});
|
|
693
|
+
var FileWriteStream = WriteStream;
|
|
694
|
+
Object.defineProperty(fs2, "FileWriteStream", {
|
|
695
|
+
get: function() {
|
|
696
|
+
return FileWriteStream;
|
|
697
|
+
},
|
|
698
|
+
set: function(val) {
|
|
699
|
+
FileWriteStream = val;
|
|
700
|
+
},
|
|
701
|
+
enumerable: true,
|
|
702
|
+
configurable: true
|
|
703
|
+
});
|
|
704
|
+
function ReadStream(path, options) {
|
|
705
|
+
if (this instanceof ReadStream)
|
|
706
|
+
return fs$ReadStream.apply(this, arguments), this;
|
|
707
|
+
else
|
|
708
|
+
return ReadStream.apply(Object.create(ReadStream.prototype), arguments);
|
|
709
|
+
}
|
|
710
|
+
function ReadStream$open() {
|
|
711
|
+
var that = this;
|
|
712
|
+
open(that.path, that.flags, that.mode, function(err, fd) {
|
|
713
|
+
if (err) {
|
|
714
|
+
if (that.autoClose)
|
|
715
|
+
that.destroy();
|
|
716
|
+
that.emit("error", err);
|
|
717
|
+
} else {
|
|
718
|
+
that.fd = fd;
|
|
719
|
+
that.emit("open", fd);
|
|
720
|
+
that.read();
|
|
721
|
+
}
|
|
722
|
+
});
|
|
723
|
+
}
|
|
724
|
+
function WriteStream(path, options) {
|
|
725
|
+
if (this instanceof WriteStream)
|
|
726
|
+
return fs$WriteStream.apply(this, arguments), this;
|
|
727
|
+
else
|
|
728
|
+
return WriteStream.apply(Object.create(WriteStream.prototype), arguments);
|
|
729
|
+
}
|
|
730
|
+
function WriteStream$open() {
|
|
731
|
+
var that = this;
|
|
732
|
+
open(that.path, that.flags, that.mode, function(err, fd) {
|
|
733
|
+
if (err) {
|
|
734
|
+
that.destroy();
|
|
735
|
+
that.emit("error", err);
|
|
736
|
+
} else {
|
|
737
|
+
that.fd = fd;
|
|
738
|
+
that.emit("open", fd);
|
|
739
|
+
}
|
|
740
|
+
});
|
|
741
|
+
}
|
|
742
|
+
function createReadStream(path, options) {
|
|
743
|
+
return new fs2.ReadStream(path, options);
|
|
744
|
+
}
|
|
745
|
+
function createWriteStream(path, options) {
|
|
746
|
+
return new fs2.WriteStream(path, options);
|
|
747
|
+
}
|
|
748
|
+
var fs$open = fs2.open;
|
|
749
|
+
fs2.open = open;
|
|
750
|
+
function open(path, flags, mode, cb) {
|
|
751
|
+
if (typeof mode === "function")
|
|
752
|
+
cb = mode, mode = null;
|
|
753
|
+
return go$open(path, flags, mode, cb);
|
|
754
|
+
function go$open(path2, flags2, mode2, cb2, startTime) {
|
|
755
|
+
return fs$open(path2, flags2, mode2, function(err, fd) {
|
|
756
|
+
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
757
|
+
enqueue([go$open, [path2, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
758
|
+
else {
|
|
759
|
+
if (typeof cb2 === "function")
|
|
760
|
+
cb2.apply(this, arguments);
|
|
761
|
+
}
|
|
762
|
+
});
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
return fs2;
|
|
766
|
+
}
|
|
767
|
+
function enqueue(elem) {
|
|
768
|
+
debug("ENQUEUE", elem[0].name, elem[1]);
|
|
769
|
+
fs[gracefulQueue].push(elem);
|
|
770
|
+
retry();
|
|
771
|
+
}
|
|
772
|
+
var retryTimer;
|
|
773
|
+
function resetQueue() {
|
|
774
|
+
var now = Date.now();
|
|
775
|
+
for (var i = 0; i < fs[gracefulQueue].length; ++i) {
|
|
776
|
+
if (fs[gracefulQueue][i].length > 2) {
|
|
777
|
+
fs[gracefulQueue][i][3] = now;
|
|
778
|
+
fs[gracefulQueue][i][4] = now;
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
retry();
|
|
782
|
+
}
|
|
783
|
+
function retry() {
|
|
784
|
+
clearTimeout(retryTimer);
|
|
785
|
+
retryTimer = void 0;
|
|
786
|
+
if (fs[gracefulQueue].length === 0)
|
|
787
|
+
return;
|
|
788
|
+
var elem = fs[gracefulQueue].shift();
|
|
789
|
+
var fn = elem[0];
|
|
790
|
+
var args = elem[1];
|
|
791
|
+
var err = elem[2];
|
|
792
|
+
var startTime = elem[3];
|
|
793
|
+
var lastTime = elem[4];
|
|
794
|
+
if (startTime === void 0) {
|
|
795
|
+
debug("RETRY", fn.name, args);
|
|
796
|
+
fn.apply(null, args);
|
|
797
|
+
} else if (Date.now() - startTime >= 6e4) {
|
|
798
|
+
debug("TIMEOUT", fn.name, args);
|
|
799
|
+
var cb = args.pop();
|
|
800
|
+
if (typeof cb === "function")
|
|
801
|
+
cb.call(null, err);
|
|
802
|
+
} else {
|
|
803
|
+
var sinceAttempt = Date.now() - lastTime;
|
|
804
|
+
var sinceStart = Math.max(lastTime - startTime, 1);
|
|
805
|
+
var desiredDelay = Math.min(sinceStart * 1.2, 100);
|
|
806
|
+
if (sinceAttempt >= desiredDelay) {
|
|
807
|
+
debug("RETRY", fn.name, args);
|
|
808
|
+
fn.apply(null, args.concat([startTime]));
|
|
809
|
+
} else {
|
|
810
|
+
fs[gracefulQueue].push(elem);
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
if (retryTimer === void 0) {
|
|
814
|
+
retryTimer = setTimeout(retry, 0);
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
});
|
|
819
|
+
|
|
820
|
+
export {
|
|
821
|
+
require_graceful_fs
|
|
822
|
+
};
|