@vercel/ruby 2.1.0 → 2.2.0
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/index.js +121 -908
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -302,9 +302,9 @@ var require_path_key = __commonJS({
|
|
|
302
302
|
}
|
|
303
303
|
});
|
|
304
304
|
|
|
305
|
-
// ../../node_modules/.pnpm/cross-spawn@6.0.
|
|
305
|
+
// ../../node_modules/.pnpm/cross-spawn@6.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js
|
|
306
306
|
var require_resolveCommand = __commonJS({
|
|
307
|
-
"../../node_modules/.pnpm/cross-spawn@6.0.
|
|
307
|
+
"../../node_modules/.pnpm/cross-spawn@6.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module2) {
|
|
308
308
|
"use strict";
|
|
309
309
|
var path = require("path");
|
|
310
310
|
var which2 = require_which();
|
|
@@ -312,7 +312,8 @@ var require_resolveCommand = __commonJS({
|
|
|
312
312
|
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
313
313
|
const cwd = process.cwd();
|
|
314
314
|
const hasCustomCwd = parsed.options.cwd != null;
|
|
315
|
-
|
|
315
|
+
const shouldSwitchCwd = hasCustomCwd && process.chdir !== void 0;
|
|
316
|
+
if (shouldSwitchCwd) {
|
|
316
317
|
try {
|
|
317
318
|
process.chdir(parsed.options.cwd);
|
|
318
319
|
} catch (err) {
|
|
@@ -326,7 +327,9 @@ var require_resolveCommand = __commonJS({
|
|
|
326
327
|
});
|
|
327
328
|
} catch (e) {
|
|
328
329
|
} finally {
|
|
329
|
-
|
|
330
|
+
if (shouldSwitchCwd) {
|
|
331
|
+
process.chdir(cwd);
|
|
332
|
+
}
|
|
330
333
|
}
|
|
331
334
|
if (resolved) {
|
|
332
335
|
resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
|
|
@@ -340,9 +343,9 @@ var require_resolveCommand = __commonJS({
|
|
|
340
343
|
}
|
|
341
344
|
});
|
|
342
345
|
|
|
343
|
-
// ../../node_modules/.pnpm/cross-spawn@6.0.
|
|
346
|
+
// ../../node_modules/.pnpm/cross-spawn@6.0.6/node_modules/cross-spawn/lib/util/escape.js
|
|
344
347
|
var require_escape = __commonJS({
|
|
345
|
-
"../../node_modules/.pnpm/cross-spawn@6.0.
|
|
348
|
+
"../../node_modules/.pnpm/cross-spawn@6.0.6/node_modules/cross-spawn/lib/util/escape.js"(exports, module2) {
|
|
346
349
|
"use strict";
|
|
347
350
|
var metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
|
|
348
351
|
function escapeCommand(arg) {
|
|
@@ -351,8 +354,8 @@ var require_escape = __commonJS({
|
|
|
351
354
|
}
|
|
352
355
|
function escapeArgument(arg, doubleEscapeMetaChars) {
|
|
353
356
|
arg = `${arg}`;
|
|
354
|
-
arg = arg.replace(/(
|
|
355
|
-
arg = arg.replace(/(
|
|
357
|
+
arg = arg.replace(/(?=(\\+?)?)\1"/g, '$1$1\\"');
|
|
358
|
+
arg = arg.replace(/(?=(\\+?)?)\1$/, "$1$1");
|
|
356
359
|
arg = `"${arg}"`;
|
|
357
360
|
arg = arg.replace(metaCharsRegExp, "^$1");
|
|
358
361
|
if (doubleEscapeMetaChars) {
|
|
@@ -391,9 +394,9 @@ var require_shebang_command = __commonJS({
|
|
|
391
394
|
}
|
|
392
395
|
});
|
|
393
396
|
|
|
394
|
-
// ../../node_modules/.pnpm/cross-spawn@6.0.
|
|
397
|
+
// ../../node_modules/.pnpm/cross-spawn@6.0.6/node_modules/cross-spawn/lib/util/readShebang.js
|
|
395
398
|
var require_readShebang = __commonJS({
|
|
396
|
-
"../../node_modules/.pnpm/cross-spawn@6.0.
|
|
399
|
+
"../../node_modules/.pnpm/cross-spawn@6.0.6/node_modules/cross-spawn/lib/util/readShebang.js"(exports, module2) {
|
|
397
400
|
"use strict";
|
|
398
401
|
var fs = require("fs");
|
|
399
402
|
var shebangCommand = require_shebang_command();
|
|
@@ -1488,9 +1491,9 @@ var require_semver = __commonJS({
|
|
|
1488
1491
|
}
|
|
1489
1492
|
});
|
|
1490
1493
|
|
|
1491
|
-
// ../../node_modules/.pnpm/cross-spawn@6.0.
|
|
1494
|
+
// ../../node_modules/.pnpm/cross-spawn@6.0.6/node_modules/cross-spawn/lib/parse.js
|
|
1492
1495
|
var require_parse = __commonJS({
|
|
1493
|
-
"../../node_modules/.pnpm/cross-spawn@6.0.
|
|
1496
|
+
"../../node_modules/.pnpm/cross-spawn@6.0.6/node_modules/cross-spawn/lib/parse.js"(exports, module2) {
|
|
1494
1497
|
"use strict";
|
|
1495
1498
|
var path = require("path");
|
|
1496
1499
|
var niceTry = require_src();
|
|
@@ -1574,9 +1577,9 @@ var require_parse = __commonJS({
|
|
|
1574
1577
|
}
|
|
1575
1578
|
});
|
|
1576
1579
|
|
|
1577
|
-
// ../../node_modules/.pnpm/cross-spawn@6.0.
|
|
1580
|
+
// ../../node_modules/.pnpm/cross-spawn@6.0.6/node_modules/cross-spawn/lib/enoent.js
|
|
1578
1581
|
var require_enoent = __commonJS({
|
|
1579
|
-
"../../node_modules/.pnpm/cross-spawn@6.0.
|
|
1582
|
+
"../../node_modules/.pnpm/cross-spawn@6.0.6/node_modules/cross-spawn/lib/enoent.js"(exports, module2) {
|
|
1580
1583
|
"use strict";
|
|
1581
1584
|
var isWin = process.platform === "win32";
|
|
1582
1585
|
function notFoundError(original, syscall) {
|
|
@@ -1624,9 +1627,9 @@ var require_enoent = __commonJS({
|
|
|
1624
1627
|
}
|
|
1625
1628
|
});
|
|
1626
1629
|
|
|
1627
|
-
// ../../node_modules/.pnpm/cross-spawn@6.0.
|
|
1630
|
+
// ../../node_modules/.pnpm/cross-spawn@6.0.6/node_modules/cross-spawn/index.js
|
|
1628
1631
|
var require_cross_spawn = __commonJS({
|
|
1629
|
-
"../../node_modules/.pnpm/cross-spawn@6.0.
|
|
1632
|
+
"../../node_modules/.pnpm/cross-spawn@6.0.6/node_modules/cross-spawn/index.js"(exports, module2) {
|
|
1630
1633
|
"use strict";
|
|
1631
1634
|
var cp = require("child_process");
|
|
1632
1635
|
var parse = require_parse();
|
|
@@ -2283,9 +2286,9 @@ var require_once = __commonJS({
|
|
|
2283
2286
|
}
|
|
2284
2287
|
});
|
|
2285
2288
|
|
|
2286
|
-
// ../../node_modules/.pnpm/end-of-stream@1.4.
|
|
2289
|
+
// ../../node_modules/.pnpm/end-of-stream@1.4.4/node_modules/end-of-stream/index.js
|
|
2287
2290
|
var require_end_of_stream = __commonJS({
|
|
2288
|
-
"../../node_modules/.pnpm/end-of-stream@1.4.
|
|
2291
|
+
"../../node_modules/.pnpm/end-of-stream@1.4.4/node_modules/end-of-stream/index.js"(exports, module2) {
|
|
2289
2292
|
var once = require_once();
|
|
2290
2293
|
var noop = function() {
|
|
2291
2294
|
};
|
|
@@ -2305,6 +2308,7 @@ var require_end_of_stream = __commonJS({
|
|
|
2305
2308
|
var rs = stream._readableState;
|
|
2306
2309
|
var readable = opts.readable || opts.readable !== false && stream.readable;
|
|
2307
2310
|
var writable = opts.writable || opts.writable !== false && stream.writable;
|
|
2311
|
+
var cancelled = false;
|
|
2308
2312
|
var onlegacyfinish = function() {
|
|
2309
2313
|
if (!stream.writable)
|
|
2310
2314
|
onfinish();
|
|
@@ -2326,9 +2330,14 @@ var require_end_of_stream = __commonJS({
|
|
|
2326
2330
|
callback.call(stream, err);
|
|
2327
2331
|
};
|
|
2328
2332
|
var onclose = function() {
|
|
2329
|
-
|
|
2333
|
+
process.nextTick(onclosenexttick);
|
|
2334
|
+
};
|
|
2335
|
+
var onclosenexttick = function() {
|
|
2336
|
+
if (cancelled)
|
|
2337
|
+
return;
|
|
2338
|
+
if (readable && !(rs && (rs.ended && !rs.destroyed)))
|
|
2330
2339
|
return callback.call(stream, new Error("premature close"));
|
|
2331
|
-
if (writable && !(ws && ws.ended))
|
|
2340
|
+
if (writable && !(ws && (ws.ended && !ws.destroyed)))
|
|
2332
2341
|
return callback.call(stream, new Error("premature close"));
|
|
2333
2342
|
};
|
|
2334
2343
|
var onrequest = function() {
|
|
@@ -2353,6 +2362,7 @@ var require_end_of_stream = __commonJS({
|
|
|
2353
2362
|
stream.on("error", onerror);
|
|
2354
2363
|
stream.on("close", onclose);
|
|
2355
2364
|
return function() {
|
|
2365
|
+
cancelled = true;
|
|
2356
2366
|
stream.removeListener("complete", onfinish);
|
|
2357
2367
|
stream.removeListener("abort", onclose);
|
|
2358
2368
|
stream.removeListener("request", onrequest);
|
|
@@ -2371,12 +2381,16 @@ var require_end_of_stream = __commonJS({
|
|
|
2371
2381
|
}
|
|
2372
2382
|
});
|
|
2373
2383
|
|
|
2374
|
-
// ../../node_modules/.pnpm/pump@3.0.
|
|
2384
|
+
// ../../node_modules/.pnpm/pump@3.0.2/node_modules/pump/index.js
|
|
2375
2385
|
var require_pump = __commonJS({
|
|
2376
|
-
"../../node_modules/.pnpm/pump@3.0.
|
|
2386
|
+
"../../node_modules/.pnpm/pump@3.0.2/node_modules/pump/index.js"(exports, module2) {
|
|
2377
2387
|
var once = require_once();
|
|
2378
2388
|
var eos = require_end_of_stream();
|
|
2379
|
-
var fs
|
|
2389
|
+
var fs;
|
|
2390
|
+
try {
|
|
2391
|
+
fs = require("fs");
|
|
2392
|
+
} catch (e) {
|
|
2393
|
+
}
|
|
2380
2394
|
var noop = function() {
|
|
2381
2395
|
};
|
|
2382
2396
|
var ancient = /^v?\.0/.test(process.version);
|
|
@@ -2997,9 +3011,9 @@ var require_universalify = __commonJS({
|
|
|
2997
3011
|
}
|
|
2998
3012
|
});
|
|
2999
3013
|
|
|
3000
|
-
// ../../node_modules/.pnpm/graceful-fs@4.2.
|
|
3014
|
+
// ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js
|
|
3001
3015
|
var require_polyfills = __commonJS({
|
|
3002
|
-
"../../node_modules/.pnpm/graceful-fs@4.2.
|
|
3016
|
+
"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js"(exports, module2) {
|
|
3003
3017
|
var constants = require("constants");
|
|
3004
3018
|
var origCwd = process.cwd;
|
|
3005
3019
|
var cwd = null;
|
|
@@ -3071,7 +3085,7 @@ var require_polyfills = __commonJS({
|
|
|
3071
3085
|
var start = Date.now();
|
|
3072
3086
|
var backoff = 0;
|
|
3073
3087
|
fs$rename(from, to, function CB(er) {
|
|
3074
|
-
if (er && (er.code === "EACCES" || er.code === "EPERM") && Date.now() - start < 6e4) {
|
|
3088
|
+
if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
|
|
3075
3089
|
setTimeout(function() {
|
|
3076
3090
|
fs.stat(to, function(stater, st) {
|
|
3077
3091
|
if (stater && stater.code === "ENOENT")
|
|
@@ -3313,9 +3327,9 @@ var require_polyfills = __commonJS({
|
|
|
3313
3327
|
}
|
|
3314
3328
|
});
|
|
3315
3329
|
|
|
3316
|
-
// ../../node_modules/.pnpm/graceful-fs@4.2.
|
|
3330
|
+
// ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js
|
|
3317
3331
|
var require_legacy_streams = __commonJS({
|
|
3318
|
-
"../../node_modules/.pnpm/graceful-fs@4.2.
|
|
3332
|
+
"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js"(exports, module2) {
|
|
3319
3333
|
var Stream = require("stream").Stream;
|
|
3320
3334
|
module2.exports = legacy;
|
|
3321
3335
|
function legacy(fs) {
|
|
@@ -3412,9 +3426,9 @@ var require_legacy_streams = __commonJS({
|
|
|
3412
3426
|
}
|
|
3413
3427
|
});
|
|
3414
3428
|
|
|
3415
|
-
// ../../node_modules/.pnpm/graceful-fs@4.2.
|
|
3429
|
+
// ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/clone.js
|
|
3416
3430
|
var require_clone = __commonJS({
|
|
3417
|
-
"../../node_modules/.pnpm/graceful-fs@4.2.
|
|
3431
|
+
"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/clone.js"(exports, module2) {
|
|
3418
3432
|
"use strict";
|
|
3419
3433
|
module2.exports = clone;
|
|
3420
3434
|
var getPrototypeOf = Object.getPrototypeOf || function(obj) {
|
|
@@ -3435,9 +3449,9 @@ var require_clone = __commonJS({
|
|
|
3435
3449
|
}
|
|
3436
3450
|
});
|
|
3437
3451
|
|
|
3438
|
-
// ../../node_modules/.pnpm/graceful-fs@4.2.
|
|
3452
|
+
// ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js
|
|
3439
3453
|
var require_graceful_fs = __commonJS({
|
|
3440
|
-
"../../node_modules/.pnpm/graceful-fs@4.2.
|
|
3454
|
+
"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js"(exports, module2) {
|
|
3441
3455
|
var fs = require("fs");
|
|
3442
3456
|
var polyfills = require_polyfills();
|
|
3443
3457
|
var legacy = require_legacy_streams();
|
|
@@ -5236,875 +5250,67 @@ var require_ensure = __commonJS({
|
|
|
5236
5250
|
}
|
|
5237
5251
|
});
|
|
5238
5252
|
|
|
5239
|
-
// ../../node_modules/.pnpm/
|
|
5240
|
-
var
|
|
5241
|
-
"../../node_modules/.pnpm/
|
|
5242
|
-
var
|
|
5243
|
-
var origCwd = process.cwd;
|
|
5244
|
-
var cwd = null;
|
|
5245
|
-
var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform;
|
|
5246
|
-
process.cwd = function() {
|
|
5247
|
-
if (!cwd)
|
|
5248
|
-
cwd = origCwd.call(process);
|
|
5249
|
-
return cwd;
|
|
5250
|
-
};
|
|
5253
|
+
// ../../node_modules/.pnpm/jsonfile@4.0.0/node_modules/jsonfile/index.js
|
|
5254
|
+
var require_jsonfile = __commonJS({
|
|
5255
|
+
"../../node_modules/.pnpm/jsonfile@4.0.0/node_modules/jsonfile/index.js"(exports, module2) {
|
|
5256
|
+
var _fs;
|
|
5251
5257
|
try {
|
|
5252
|
-
|
|
5253
|
-
} catch (
|
|
5254
|
-
|
|
5255
|
-
if (typeof process.chdir === "function") {
|
|
5256
|
-
chdir = process.chdir;
|
|
5257
|
-
process.chdir = function(d) {
|
|
5258
|
-
cwd = null;
|
|
5259
|
-
chdir.call(process, d);
|
|
5260
|
-
};
|
|
5261
|
-
if (Object.setPrototypeOf)
|
|
5262
|
-
Object.setPrototypeOf(process.chdir, chdir);
|
|
5258
|
+
_fs = require_graceful_fs();
|
|
5259
|
+
} catch (_) {
|
|
5260
|
+
_fs = require("fs");
|
|
5263
5261
|
}
|
|
5264
|
-
|
|
5265
|
-
|
|
5266
|
-
|
|
5267
|
-
|
|
5268
|
-
patchLchmod(fs);
|
|
5269
|
-
}
|
|
5270
|
-
if (!fs.lutimes) {
|
|
5271
|
-
patchLutimes(fs);
|
|
5262
|
+
function readFile2(file, options, callback) {
|
|
5263
|
+
if (callback == null) {
|
|
5264
|
+
callback = options;
|
|
5265
|
+
options = {};
|
|
5272
5266
|
}
|
|
5273
|
-
|
|
5274
|
-
|
|
5275
|
-
fs.lchown = chownFix(fs.lchown);
|
|
5276
|
-
fs.chmod = chmodFix(fs.chmod);
|
|
5277
|
-
fs.fchmod = chmodFix(fs.fchmod);
|
|
5278
|
-
fs.lchmod = chmodFix(fs.lchmod);
|
|
5279
|
-
fs.chownSync = chownFixSync(fs.chownSync);
|
|
5280
|
-
fs.fchownSync = chownFixSync(fs.fchownSync);
|
|
5281
|
-
fs.lchownSync = chownFixSync(fs.lchownSync);
|
|
5282
|
-
fs.chmodSync = chmodFixSync(fs.chmodSync);
|
|
5283
|
-
fs.fchmodSync = chmodFixSync(fs.fchmodSync);
|
|
5284
|
-
fs.lchmodSync = chmodFixSync(fs.lchmodSync);
|
|
5285
|
-
fs.stat = statFix(fs.stat);
|
|
5286
|
-
fs.fstat = statFix(fs.fstat);
|
|
5287
|
-
fs.lstat = statFix(fs.lstat);
|
|
5288
|
-
fs.statSync = statFixSync(fs.statSync);
|
|
5289
|
-
fs.fstatSync = statFixSync(fs.fstatSync);
|
|
5290
|
-
fs.lstatSync = statFixSync(fs.lstatSync);
|
|
5291
|
-
if (fs.chmod && !fs.lchmod) {
|
|
5292
|
-
fs.lchmod = function(path, mode, cb) {
|
|
5293
|
-
if (cb)
|
|
5294
|
-
process.nextTick(cb);
|
|
5295
|
-
};
|
|
5296
|
-
fs.lchmodSync = function() {
|
|
5297
|
-
};
|
|
5267
|
+
if (typeof options === "string") {
|
|
5268
|
+
options = { encoding: options };
|
|
5298
5269
|
}
|
|
5299
|
-
|
|
5300
|
-
|
|
5301
|
-
|
|
5302
|
-
|
|
5303
|
-
|
|
5304
|
-
fs.lchownSync = function() {
|
|
5305
|
-
};
|
|
5270
|
+
options = options || {};
|
|
5271
|
+
var fs = options.fs || _fs;
|
|
5272
|
+
var shouldThrow = true;
|
|
5273
|
+
if ("throws" in options) {
|
|
5274
|
+
shouldThrow = options.throws;
|
|
5306
5275
|
}
|
|
5307
|
-
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
|
|
5311
|
-
|
|
5312
|
-
|
|
5313
|
-
|
|
5314
|
-
|
|
5315
|
-
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
|
|
5319
|
-
|
|
5320
|
-
});
|
|
5321
|
-
}, backoff);
|
|
5322
|
-
if (backoff < 100)
|
|
5323
|
-
backoff += 10;
|
|
5324
|
-
return;
|
|
5325
|
-
}
|
|
5326
|
-
if (cb)
|
|
5327
|
-
cb(er);
|
|
5328
|
-
});
|
|
5276
|
+
fs.readFile(file, options, function(err, data) {
|
|
5277
|
+
if (err)
|
|
5278
|
+
return callback(err);
|
|
5279
|
+
data = stripBom(data);
|
|
5280
|
+
var obj;
|
|
5281
|
+
try {
|
|
5282
|
+
obj = JSON.parse(data, options ? options.reviver : null);
|
|
5283
|
+
} catch (err2) {
|
|
5284
|
+
if (shouldThrow) {
|
|
5285
|
+
err2.message = file + ": " + err2.message;
|
|
5286
|
+
return callback(err2);
|
|
5287
|
+
} else {
|
|
5288
|
+
return callback(null, null);
|
|
5329
5289
|
}
|
|
5330
|
-
|
|
5331
|
-
|
|
5332
|
-
|
|
5333
|
-
|
|
5290
|
+
}
|
|
5291
|
+
callback(null, obj);
|
|
5292
|
+
});
|
|
5293
|
+
}
|
|
5294
|
+
function readFileSync(file, options) {
|
|
5295
|
+
options = options || {};
|
|
5296
|
+
if (typeof options === "string") {
|
|
5297
|
+
options = { encoding: options };
|
|
5334
5298
|
}
|
|
5335
|
-
fs
|
|
5336
|
-
|
|
5337
|
-
|
|
5338
|
-
|
|
5339
|
-
|
|
5340
|
-
|
|
5341
|
-
|
|
5342
|
-
|
|
5343
|
-
|
|
5344
|
-
|
|
5345
|
-
|
|
5346
|
-
|
|
5347
|
-
|
|
5348
|
-
|
|
5349
|
-
|
|
5350
|
-
if (Object.setPrototypeOf)
|
|
5351
|
-
Object.setPrototypeOf(read, fs$read);
|
|
5352
|
-
return read;
|
|
5353
|
-
}(fs.read);
|
|
5354
|
-
fs.readSync = typeof fs.readSync !== "function" ? fs.readSync : function(fs$readSync) {
|
|
5355
|
-
return function(fd, buffer, offset, length, position) {
|
|
5356
|
-
var eagCounter = 0;
|
|
5357
|
-
while (true) {
|
|
5358
|
-
try {
|
|
5359
|
-
return fs$readSync.call(fs, fd, buffer, offset, length, position);
|
|
5360
|
-
} catch (er) {
|
|
5361
|
-
if (er.code === "EAGAIN" && eagCounter < 10) {
|
|
5362
|
-
eagCounter++;
|
|
5363
|
-
continue;
|
|
5364
|
-
}
|
|
5365
|
-
throw er;
|
|
5366
|
-
}
|
|
5367
|
-
}
|
|
5368
|
-
};
|
|
5369
|
-
}(fs.readSync);
|
|
5370
|
-
function patchLchmod(fs2) {
|
|
5371
|
-
fs2.lchmod = function(path, mode, callback) {
|
|
5372
|
-
fs2.open(
|
|
5373
|
-
path,
|
|
5374
|
-
constants.O_WRONLY | constants.O_SYMLINK,
|
|
5375
|
-
mode,
|
|
5376
|
-
function(err, fd) {
|
|
5377
|
-
if (err) {
|
|
5378
|
-
if (callback)
|
|
5379
|
-
callback(err);
|
|
5380
|
-
return;
|
|
5381
|
-
}
|
|
5382
|
-
fs2.fchmod(fd, mode, function(err2) {
|
|
5383
|
-
fs2.close(fd, function(err22) {
|
|
5384
|
-
if (callback)
|
|
5385
|
-
callback(err2 || err22);
|
|
5386
|
-
});
|
|
5387
|
-
});
|
|
5388
|
-
}
|
|
5389
|
-
);
|
|
5390
|
-
};
|
|
5391
|
-
fs2.lchmodSync = function(path, mode) {
|
|
5392
|
-
var fd = fs2.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode);
|
|
5393
|
-
var threw = true;
|
|
5394
|
-
var ret;
|
|
5395
|
-
try {
|
|
5396
|
-
ret = fs2.fchmodSync(fd, mode);
|
|
5397
|
-
threw = false;
|
|
5398
|
-
} finally {
|
|
5399
|
-
if (threw) {
|
|
5400
|
-
try {
|
|
5401
|
-
fs2.closeSync(fd);
|
|
5402
|
-
} catch (er) {
|
|
5403
|
-
}
|
|
5404
|
-
} else {
|
|
5405
|
-
fs2.closeSync(fd);
|
|
5406
|
-
}
|
|
5407
|
-
}
|
|
5408
|
-
return ret;
|
|
5409
|
-
};
|
|
5410
|
-
}
|
|
5411
|
-
function patchLutimes(fs2) {
|
|
5412
|
-
if (constants.hasOwnProperty("O_SYMLINK") && fs2.futimes) {
|
|
5413
|
-
fs2.lutimes = function(path, at, mt, cb) {
|
|
5414
|
-
fs2.open(path, constants.O_SYMLINK, function(er, fd) {
|
|
5415
|
-
if (er) {
|
|
5416
|
-
if (cb)
|
|
5417
|
-
cb(er);
|
|
5418
|
-
return;
|
|
5419
|
-
}
|
|
5420
|
-
fs2.futimes(fd, at, mt, function(er2) {
|
|
5421
|
-
fs2.close(fd, function(er22) {
|
|
5422
|
-
if (cb)
|
|
5423
|
-
cb(er2 || er22);
|
|
5424
|
-
});
|
|
5425
|
-
});
|
|
5426
|
-
});
|
|
5427
|
-
};
|
|
5428
|
-
fs2.lutimesSync = function(path, at, mt) {
|
|
5429
|
-
var fd = fs2.openSync(path, constants.O_SYMLINK);
|
|
5430
|
-
var ret;
|
|
5431
|
-
var threw = true;
|
|
5432
|
-
try {
|
|
5433
|
-
ret = fs2.futimesSync(fd, at, mt);
|
|
5434
|
-
threw = false;
|
|
5435
|
-
} finally {
|
|
5436
|
-
if (threw) {
|
|
5437
|
-
try {
|
|
5438
|
-
fs2.closeSync(fd);
|
|
5439
|
-
} catch (er) {
|
|
5440
|
-
}
|
|
5441
|
-
} else {
|
|
5442
|
-
fs2.closeSync(fd);
|
|
5443
|
-
}
|
|
5444
|
-
}
|
|
5445
|
-
return ret;
|
|
5446
|
-
};
|
|
5447
|
-
} else if (fs2.futimes) {
|
|
5448
|
-
fs2.lutimes = function(_a, _b, _c, cb) {
|
|
5449
|
-
if (cb)
|
|
5450
|
-
process.nextTick(cb);
|
|
5451
|
-
};
|
|
5452
|
-
fs2.lutimesSync = function() {
|
|
5453
|
-
};
|
|
5454
|
-
}
|
|
5455
|
-
}
|
|
5456
|
-
function chmodFix(orig) {
|
|
5457
|
-
if (!orig)
|
|
5458
|
-
return orig;
|
|
5459
|
-
return function(target, mode, cb) {
|
|
5460
|
-
return orig.call(fs, target, mode, function(er) {
|
|
5461
|
-
if (chownErOk(er))
|
|
5462
|
-
er = null;
|
|
5463
|
-
if (cb)
|
|
5464
|
-
cb.apply(this, arguments);
|
|
5465
|
-
});
|
|
5466
|
-
};
|
|
5467
|
-
}
|
|
5468
|
-
function chmodFixSync(orig) {
|
|
5469
|
-
if (!orig)
|
|
5470
|
-
return orig;
|
|
5471
|
-
return function(target, mode) {
|
|
5472
|
-
try {
|
|
5473
|
-
return orig.call(fs, target, mode);
|
|
5474
|
-
} catch (er) {
|
|
5475
|
-
if (!chownErOk(er))
|
|
5476
|
-
throw er;
|
|
5477
|
-
}
|
|
5478
|
-
};
|
|
5479
|
-
}
|
|
5480
|
-
function chownFix(orig) {
|
|
5481
|
-
if (!orig)
|
|
5482
|
-
return orig;
|
|
5483
|
-
return function(target, uid, gid, cb) {
|
|
5484
|
-
return orig.call(fs, target, uid, gid, function(er) {
|
|
5485
|
-
if (chownErOk(er))
|
|
5486
|
-
er = null;
|
|
5487
|
-
if (cb)
|
|
5488
|
-
cb.apply(this, arguments);
|
|
5489
|
-
});
|
|
5490
|
-
};
|
|
5491
|
-
}
|
|
5492
|
-
function chownFixSync(orig) {
|
|
5493
|
-
if (!orig)
|
|
5494
|
-
return orig;
|
|
5495
|
-
return function(target, uid, gid) {
|
|
5496
|
-
try {
|
|
5497
|
-
return orig.call(fs, target, uid, gid);
|
|
5498
|
-
} catch (er) {
|
|
5499
|
-
if (!chownErOk(er))
|
|
5500
|
-
throw er;
|
|
5501
|
-
}
|
|
5502
|
-
};
|
|
5503
|
-
}
|
|
5504
|
-
function statFix(orig) {
|
|
5505
|
-
if (!orig)
|
|
5506
|
-
return orig;
|
|
5507
|
-
return function(target, options, cb) {
|
|
5508
|
-
if (typeof options === "function") {
|
|
5509
|
-
cb = options;
|
|
5510
|
-
options = null;
|
|
5511
|
-
}
|
|
5512
|
-
function callback(er, stats) {
|
|
5513
|
-
if (stats) {
|
|
5514
|
-
if (stats.uid < 0)
|
|
5515
|
-
stats.uid += 4294967296;
|
|
5516
|
-
if (stats.gid < 0)
|
|
5517
|
-
stats.gid += 4294967296;
|
|
5518
|
-
}
|
|
5519
|
-
if (cb)
|
|
5520
|
-
cb.apply(this, arguments);
|
|
5521
|
-
}
|
|
5522
|
-
return options ? orig.call(fs, target, options, callback) : orig.call(fs, target, callback);
|
|
5523
|
-
};
|
|
5524
|
-
}
|
|
5525
|
-
function statFixSync(orig) {
|
|
5526
|
-
if (!orig)
|
|
5527
|
-
return orig;
|
|
5528
|
-
return function(target, options) {
|
|
5529
|
-
var stats = options ? orig.call(fs, target, options) : orig.call(fs, target);
|
|
5530
|
-
if (stats) {
|
|
5531
|
-
if (stats.uid < 0)
|
|
5532
|
-
stats.uid += 4294967296;
|
|
5533
|
-
if (stats.gid < 0)
|
|
5534
|
-
stats.gid += 4294967296;
|
|
5535
|
-
}
|
|
5536
|
-
return stats;
|
|
5537
|
-
};
|
|
5538
|
-
}
|
|
5539
|
-
function chownErOk(er) {
|
|
5540
|
-
if (!er)
|
|
5541
|
-
return true;
|
|
5542
|
-
if (er.code === "ENOSYS")
|
|
5543
|
-
return true;
|
|
5544
|
-
var nonroot = !process.getuid || process.getuid() !== 0;
|
|
5545
|
-
if (nonroot) {
|
|
5546
|
-
if (er.code === "EINVAL" || er.code === "EPERM")
|
|
5547
|
-
return true;
|
|
5548
|
-
}
|
|
5549
|
-
return false;
|
|
5550
|
-
}
|
|
5551
|
-
}
|
|
5552
|
-
}
|
|
5553
|
-
});
|
|
5554
|
-
|
|
5555
|
-
// ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js
|
|
5556
|
-
var require_legacy_streams2 = __commonJS({
|
|
5557
|
-
"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js"(exports, module2) {
|
|
5558
|
-
var Stream = require("stream").Stream;
|
|
5559
|
-
module2.exports = legacy;
|
|
5560
|
-
function legacy(fs) {
|
|
5561
|
-
return {
|
|
5562
|
-
ReadStream,
|
|
5563
|
-
WriteStream
|
|
5564
|
-
};
|
|
5565
|
-
function ReadStream(path, options) {
|
|
5566
|
-
if (!(this instanceof ReadStream))
|
|
5567
|
-
return new ReadStream(path, options);
|
|
5568
|
-
Stream.call(this);
|
|
5569
|
-
var self = this;
|
|
5570
|
-
this.path = path;
|
|
5571
|
-
this.fd = null;
|
|
5572
|
-
this.readable = true;
|
|
5573
|
-
this.paused = false;
|
|
5574
|
-
this.flags = "r";
|
|
5575
|
-
this.mode = 438;
|
|
5576
|
-
this.bufferSize = 64 * 1024;
|
|
5577
|
-
options = options || {};
|
|
5578
|
-
var keys = Object.keys(options);
|
|
5579
|
-
for (var index = 0, length = keys.length; index < length; index++) {
|
|
5580
|
-
var key = keys[index];
|
|
5581
|
-
this[key] = options[key];
|
|
5582
|
-
}
|
|
5583
|
-
if (this.encoding)
|
|
5584
|
-
this.setEncoding(this.encoding);
|
|
5585
|
-
if (this.start !== void 0) {
|
|
5586
|
-
if ("number" !== typeof this.start) {
|
|
5587
|
-
throw TypeError("start must be a Number");
|
|
5588
|
-
}
|
|
5589
|
-
if (this.end === void 0) {
|
|
5590
|
-
this.end = Infinity;
|
|
5591
|
-
} else if ("number" !== typeof this.end) {
|
|
5592
|
-
throw TypeError("end must be a Number");
|
|
5593
|
-
}
|
|
5594
|
-
if (this.start > this.end) {
|
|
5595
|
-
throw new Error("start must be <= end");
|
|
5596
|
-
}
|
|
5597
|
-
this.pos = this.start;
|
|
5598
|
-
}
|
|
5599
|
-
if (this.fd !== null) {
|
|
5600
|
-
process.nextTick(function() {
|
|
5601
|
-
self._read();
|
|
5602
|
-
});
|
|
5603
|
-
return;
|
|
5604
|
-
}
|
|
5605
|
-
fs.open(this.path, this.flags, this.mode, function(err, fd) {
|
|
5606
|
-
if (err) {
|
|
5607
|
-
self.emit("error", err);
|
|
5608
|
-
self.readable = false;
|
|
5609
|
-
return;
|
|
5610
|
-
}
|
|
5611
|
-
self.fd = fd;
|
|
5612
|
-
self.emit("open", fd);
|
|
5613
|
-
self._read();
|
|
5614
|
-
});
|
|
5615
|
-
}
|
|
5616
|
-
function WriteStream(path, options) {
|
|
5617
|
-
if (!(this instanceof WriteStream))
|
|
5618
|
-
return new WriteStream(path, options);
|
|
5619
|
-
Stream.call(this);
|
|
5620
|
-
this.path = path;
|
|
5621
|
-
this.fd = null;
|
|
5622
|
-
this.writable = true;
|
|
5623
|
-
this.flags = "w";
|
|
5624
|
-
this.encoding = "binary";
|
|
5625
|
-
this.mode = 438;
|
|
5626
|
-
this.bytesWritten = 0;
|
|
5627
|
-
options = options || {};
|
|
5628
|
-
var keys = Object.keys(options);
|
|
5629
|
-
for (var index = 0, length = keys.length; index < length; index++) {
|
|
5630
|
-
var key = keys[index];
|
|
5631
|
-
this[key] = options[key];
|
|
5632
|
-
}
|
|
5633
|
-
if (this.start !== void 0) {
|
|
5634
|
-
if ("number" !== typeof this.start) {
|
|
5635
|
-
throw TypeError("start must be a Number");
|
|
5636
|
-
}
|
|
5637
|
-
if (this.start < 0) {
|
|
5638
|
-
throw new Error("start must be >= zero");
|
|
5639
|
-
}
|
|
5640
|
-
this.pos = this.start;
|
|
5641
|
-
}
|
|
5642
|
-
this.busy = false;
|
|
5643
|
-
this._queue = [];
|
|
5644
|
-
if (this.fd === null) {
|
|
5645
|
-
this._open = fs.open;
|
|
5646
|
-
this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
|
|
5647
|
-
this.flush();
|
|
5648
|
-
}
|
|
5649
|
-
}
|
|
5650
|
-
}
|
|
5651
|
-
}
|
|
5652
|
-
});
|
|
5653
|
-
|
|
5654
|
-
// ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/clone.js
|
|
5655
|
-
var require_clone2 = __commonJS({
|
|
5656
|
-
"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/clone.js"(exports, module2) {
|
|
5657
|
-
"use strict";
|
|
5658
|
-
module2.exports = clone;
|
|
5659
|
-
var getPrototypeOf = Object.getPrototypeOf || function(obj) {
|
|
5660
|
-
return obj.__proto__;
|
|
5661
|
-
};
|
|
5662
|
-
function clone(obj) {
|
|
5663
|
-
if (obj === null || typeof obj !== "object")
|
|
5664
|
-
return obj;
|
|
5665
|
-
if (obj instanceof Object)
|
|
5666
|
-
var copy = { __proto__: getPrototypeOf(obj) };
|
|
5667
|
-
else
|
|
5668
|
-
var copy = /* @__PURE__ */ Object.create(null);
|
|
5669
|
-
Object.getOwnPropertyNames(obj).forEach(function(key) {
|
|
5670
|
-
Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key));
|
|
5671
|
-
});
|
|
5672
|
-
return copy;
|
|
5673
|
-
}
|
|
5674
|
-
}
|
|
5675
|
-
});
|
|
5676
|
-
|
|
5677
|
-
// ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js
|
|
5678
|
-
var require_graceful_fs2 = __commonJS({
|
|
5679
|
-
"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js"(exports, module2) {
|
|
5680
|
-
var fs = require("fs");
|
|
5681
|
-
var polyfills = require_polyfills2();
|
|
5682
|
-
var legacy = require_legacy_streams2();
|
|
5683
|
-
var clone = require_clone2();
|
|
5684
|
-
var util = require("util");
|
|
5685
|
-
var gracefulQueue;
|
|
5686
|
-
var previousSymbol;
|
|
5687
|
-
if (typeof Symbol === "function" && typeof Symbol.for === "function") {
|
|
5688
|
-
gracefulQueue = Symbol.for("graceful-fs.queue");
|
|
5689
|
-
previousSymbol = Symbol.for("graceful-fs.previous");
|
|
5690
|
-
} else {
|
|
5691
|
-
gracefulQueue = "___graceful-fs.queue";
|
|
5692
|
-
previousSymbol = "___graceful-fs.previous";
|
|
5693
|
-
}
|
|
5694
|
-
function noop() {
|
|
5695
|
-
}
|
|
5696
|
-
function publishQueue(context, queue2) {
|
|
5697
|
-
Object.defineProperty(context, gracefulQueue, {
|
|
5698
|
-
get: function() {
|
|
5699
|
-
return queue2;
|
|
5700
|
-
}
|
|
5701
|
-
});
|
|
5702
|
-
}
|
|
5703
|
-
var debug3 = noop;
|
|
5704
|
-
if (util.debuglog)
|
|
5705
|
-
debug3 = util.debuglog("gfs4");
|
|
5706
|
-
else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ""))
|
|
5707
|
-
debug3 = function() {
|
|
5708
|
-
var m = util.format.apply(util, arguments);
|
|
5709
|
-
m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
|
|
5710
|
-
console.error(m);
|
|
5711
|
-
};
|
|
5712
|
-
if (!fs[gracefulQueue]) {
|
|
5713
|
-
queue = global[gracefulQueue] || [];
|
|
5714
|
-
publishQueue(fs, queue);
|
|
5715
|
-
fs.close = function(fs$close) {
|
|
5716
|
-
function close(fd, cb) {
|
|
5717
|
-
return fs$close.call(fs, fd, function(err) {
|
|
5718
|
-
if (!err) {
|
|
5719
|
-
resetQueue();
|
|
5720
|
-
}
|
|
5721
|
-
if (typeof cb === "function")
|
|
5722
|
-
cb.apply(this, arguments);
|
|
5723
|
-
});
|
|
5724
|
-
}
|
|
5725
|
-
Object.defineProperty(close, previousSymbol, {
|
|
5726
|
-
value: fs$close
|
|
5727
|
-
});
|
|
5728
|
-
return close;
|
|
5729
|
-
}(fs.close);
|
|
5730
|
-
fs.closeSync = function(fs$closeSync) {
|
|
5731
|
-
function closeSync(fd) {
|
|
5732
|
-
fs$closeSync.apply(fs, arguments);
|
|
5733
|
-
resetQueue();
|
|
5734
|
-
}
|
|
5735
|
-
Object.defineProperty(closeSync, previousSymbol, {
|
|
5736
|
-
value: fs$closeSync
|
|
5737
|
-
});
|
|
5738
|
-
return closeSync;
|
|
5739
|
-
}(fs.closeSync);
|
|
5740
|
-
if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
|
|
5741
|
-
process.on("exit", function() {
|
|
5742
|
-
debug3(fs[gracefulQueue]);
|
|
5743
|
-
require("assert").equal(fs[gracefulQueue].length, 0);
|
|
5744
|
-
});
|
|
5745
|
-
}
|
|
5746
|
-
}
|
|
5747
|
-
var queue;
|
|
5748
|
-
if (!global[gracefulQueue]) {
|
|
5749
|
-
publishQueue(global, fs[gracefulQueue]);
|
|
5750
|
-
}
|
|
5751
|
-
module2.exports = patch(clone(fs));
|
|
5752
|
-
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) {
|
|
5753
|
-
module2.exports = patch(fs);
|
|
5754
|
-
fs.__patched = true;
|
|
5755
|
-
}
|
|
5756
|
-
function patch(fs2) {
|
|
5757
|
-
polyfills(fs2);
|
|
5758
|
-
fs2.gracefulify = patch;
|
|
5759
|
-
fs2.createReadStream = createReadStream;
|
|
5760
|
-
fs2.createWriteStream = createWriteStream;
|
|
5761
|
-
var fs$readFile = fs2.readFile;
|
|
5762
|
-
fs2.readFile = readFile2;
|
|
5763
|
-
function readFile2(path, options, cb) {
|
|
5764
|
-
if (typeof options === "function")
|
|
5765
|
-
cb = options, options = null;
|
|
5766
|
-
return go$readFile(path, options, cb);
|
|
5767
|
-
function go$readFile(path2, options2, cb2, startTime) {
|
|
5768
|
-
return fs$readFile(path2, options2, function(err) {
|
|
5769
|
-
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
5770
|
-
enqueue([go$readFile, [path2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
5771
|
-
else {
|
|
5772
|
-
if (typeof cb2 === "function")
|
|
5773
|
-
cb2.apply(this, arguments);
|
|
5774
|
-
}
|
|
5775
|
-
});
|
|
5776
|
-
}
|
|
5777
|
-
}
|
|
5778
|
-
var fs$writeFile = fs2.writeFile;
|
|
5779
|
-
fs2.writeFile = writeFile2;
|
|
5780
|
-
function writeFile2(path, data, options, cb) {
|
|
5781
|
-
if (typeof options === "function")
|
|
5782
|
-
cb = options, options = null;
|
|
5783
|
-
return go$writeFile(path, data, options, cb);
|
|
5784
|
-
function go$writeFile(path2, data2, options2, cb2, startTime) {
|
|
5785
|
-
return fs$writeFile(path2, data2, options2, function(err) {
|
|
5786
|
-
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
5787
|
-
enqueue([go$writeFile, [path2, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
5788
|
-
else {
|
|
5789
|
-
if (typeof cb2 === "function")
|
|
5790
|
-
cb2.apply(this, arguments);
|
|
5791
|
-
}
|
|
5792
|
-
});
|
|
5793
|
-
}
|
|
5794
|
-
}
|
|
5795
|
-
var fs$appendFile = fs2.appendFile;
|
|
5796
|
-
if (fs$appendFile)
|
|
5797
|
-
fs2.appendFile = appendFile;
|
|
5798
|
-
function appendFile(path, data, options, cb) {
|
|
5799
|
-
if (typeof options === "function")
|
|
5800
|
-
cb = options, options = null;
|
|
5801
|
-
return go$appendFile(path, data, options, cb);
|
|
5802
|
-
function go$appendFile(path2, data2, options2, cb2, startTime) {
|
|
5803
|
-
return fs$appendFile(path2, data2, options2, function(err) {
|
|
5804
|
-
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
5805
|
-
enqueue([go$appendFile, [path2, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
5806
|
-
else {
|
|
5807
|
-
if (typeof cb2 === "function")
|
|
5808
|
-
cb2.apply(this, arguments);
|
|
5809
|
-
}
|
|
5810
|
-
});
|
|
5811
|
-
}
|
|
5812
|
-
}
|
|
5813
|
-
var fs$copyFile = fs2.copyFile;
|
|
5814
|
-
if (fs$copyFile)
|
|
5815
|
-
fs2.copyFile = copyFile;
|
|
5816
|
-
function copyFile(src, dest, flags, cb) {
|
|
5817
|
-
if (typeof flags === "function") {
|
|
5818
|
-
cb = flags;
|
|
5819
|
-
flags = 0;
|
|
5820
|
-
}
|
|
5821
|
-
return go$copyFile(src, dest, flags, cb);
|
|
5822
|
-
function go$copyFile(src2, dest2, flags2, cb2, startTime) {
|
|
5823
|
-
return fs$copyFile(src2, dest2, flags2, function(err) {
|
|
5824
|
-
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
5825
|
-
enqueue([go$copyFile, [src2, dest2, flags2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
5826
|
-
else {
|
|
5827
|
-
if (typeof cb2 === "function")
|
|
5828
|
-
cb2.apply(this, arguments);
|
|
5829
|
-
}
|
|
5830
|
-
});
|
|
5831
|
-
}
|
|
5832
|
-
}
|
|
5833
|
-
var fs$readdir = fs2.readdir;
|
|
5834
|
-
fs2.readdir = readdir;
|
|
5835
|
-
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
5836
|
-
function readdir(path, options, cb) {
|
|
5837
|
-
if (typeof options === "function")
|
|
5838
|
-
cb = options, options = null;
|
|
5839
|
-
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path2, options2, cb2, startTime) {
|
|
5840
|
-
return fs$readdir(path2, fs$readdirCallback(
|
|
5841
|
-
path2,
|
|
5842
|
-
options2,
|
|
5843
|
-
cb2,
|
|
5844
|
-
startTime
|
|
5845
|
-
));
|
|
5846
|
-
} : function go$readdir2(path2, options2, cb2, startTime) {
|
|
5847
|
-
return fs$readdir(path2, options2, fs$readdirCallback(
|
|
5848
|
-
path2,
|
|
5849
|
-
options2,
|
|
5850
|
-
cb2,
|
|
5851
|
-
startTime
|
|
5852
|
-
));
|
|
5853
|
-
};
|
|
5854
|
-
return go$readdir(path, options, cb);
|
|
5855
|
-
function fs$readdirCallback(path2, options2, cb2, startTime) {
|
|
5856
|
-
return function(err, files) {
|
|
5857
|
-
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
5858
|
-
enqueue([
|
|
5859
|
-
go$readdir,
|
|
5860
|
-
[path2, options2, cb2],
|
|
5861
|
-
err,
|
|
5862
|
-
startTime || Date.now(),
|
|
5863
|
-
Date.now()
|
|
5864
|
-
]);
|
|
5865
|
-
else {
|
|
5866
|
-
if (files && files.sort)
|
|
5867
|
-
files.sort();
|
|
5868
|
-
if (typeof cb2 === "function")
|
|
5869
|
-
cb2.call(this, err, files);
|
|
5870
|
-
}
|
|
5871
|
-
};
|
|
5872
|
-
}
|
|
5873
|
-
}
|
|
5874
|
-
if (process.version.substr(0, 4) === "v0.8") {
|
|
5875
|
-
var legStreams = legacy(fs2);
|
|
5876
|
-
ReadStream = legStreams.ReadStream;
|
|
5877
|
-
WriteStream = legStreams.WriteStream;
|
|
5878
|
-
}
|
|
5879
|
-
var fs$ReadStream = fs2.ReadStream;
|
|
5880
|
-
if (fs$ReadStream) {
|
|
5881
|
-
ReadStream.prototype = Object.create(fs$ReadStream.prototype);
|
|
5882
|
-
ReadStream.prototype.open = ReadStream$open;
|
|
5883
|
-
}
|
|
5884
|
-
var fs$WriteStream = fs2.WriteStream;
|
|
5885
|
-
if (fs$WriteStream) {
|
|
5886
|
-
WriteStream.prototype = Object.create(fs$WriteStream.prototype);
|
|
5887
|
-
WriteStream.prototype.open = WriteStream$open;
|
|
5888
|
-
}
|
|
5889
|
-
Object.defineProperty(fs2, "ReadStream", {
|
|
5890
|
-
get: function() {
|
|
5891
|
-
return ReadStream;
|
|
5892
|
-
},
|
|
5893
|
-
set: function(val) {
|
|
5894
|
-
ReadStream = val;
|
|
5895
|
-
},
|
|
5896
|
-
enumerable: true,
|
|
5897
|
-
configurable: true
|
|
5898
|
-
});
|
|
5899
|
-
Object.defineProperty(fs2, "WriteStream", {
|
|
5900
|
-
get: function() {
|
|
5901
|
-
return WriteStream;
|
|
5902
|
-
},
|
|
5903
|
-
set: function(val) {
|
|
5904
|
-
WriteStream = val;
|
|
5905
|
-
},
|
|
5906
|
-
enumerable: true,
|
|
5907
|
-
configurable: true
|
|
5908
|
-
});
|
|
5909
|
-
var FileReadStream = ReadStream;
|
|
5910
|
-
Object.defineProperty(fs2, "FileReadStream", {
|
|
5911
|
-
get: function() {
|
|
5912
|
-
return FileReadStream;
|
|
5913
|
-
},
|
|
5914
|
-
set: function(val) {
|
|
5915
|
-
FileReadStream = val;
|
|
5916
|
-
},
|
|
5917
|
-
enumerable: true,
|
|
5918
|
-
configurable: true
|
|
5919
|
-
});
|
|
5920
|
-
var FileWriteStream = WriteStream;
|
|
5921
|
-
Object.defineProperty(fs2, "FileWriteStream", {
|
|
5922
|
-
get: function() {
|
|
5923
|
-
return FileWriteStream;
|
|
5924
|
-
},
|
|
5925
|
-
set: function(val) {
|
|
5926
|
-
FileWriteStream = val;
|
|
5927
|
-
},
|
|
5928
|
-
enumerable: true,
|
|
5929
|
-
configurable: true
|
|
5930
|
-
});
|
|
5931
|
-
function ReadStream(path, options) {
|
|
5932
|
-
if (this instanceof ReadStream)
|
|
5933
|
-
return fs$ReadStream.apply(this, arguments), this;
|
|
5934
|
-
else
|
|
5935
|
-
return ReadStream.apply(Object.create(ReadStream.prototype), arguments);
|
|
5936
|
-
}
|
|
5937
|
-
function ReadStream$open() {
|
|
5938
|
-
var that = this;
|
|
5939
|
-
open(that.path, that.flags, that.mode, function(err, fd) {
|
|
5940
|
-
if (err) {
|
|
5941
|
-
if (that.autoClose)
|
|
5942
|
-
that.destroy();
|
|
5943
|
-
that.emit("error", err);
|
|
5944
|
-
} else {
|
|
5945
|
-
that.fd = fd;
|
|
5946
|
-
that.emit("open", fd);
|
|
5947
|
-
that.read();
|
|
5948
|
-
}
|
|
5949
|
-
});
|
|
5950
|
-
}
|
|
5951
|
-
function WriteStream(path, options) {
|
|
5952
|
-
if (this instanceof WriteStream)
|
|
5953
|
-
return fs$WriteStream.apply(this, arguments), this;
|
|
5954
|
-
else
|
|
5955
|
-
return WriteStream.apply(Object.create(WriteStream.prototype), arguments);
|
|
5956
|
-
}
|
|
5957
|
-
function WriteStream$open() {
|
|
5958
|
-
var that = this;
|
|
5959
|
-
open(that.path, that.flags, that.mode, function(err, fd) {
|
|
5960
|
-
if (err) {
|
|
5961
|
-
that.destroy();
|
|
5962
|
-
that.emit("error", err);
|
|
5963
|
-
} else {
|
|
5964
|
-
that.fd = fd;
|
|
5965
|
-
that.emit("open", fd);
|
|
5966
|
-
}
|
|
5967
|
-
});
|
|
5968
|
-
}
|
|
5969
|
-
function createReadStream(path, options) {
|
|
5970
|
-
return new fs2.ReadStream(path, options);
|
|
5971
|
-
}
|
|
5972
|
-
function createWriteStream(path, options) {
|
|
5973
|
-
return new fs2.WriteStream(path, options);
|
|
5974
|
-
}
|
|
5975
|
-
var fs$open = fs2.open;
|
|
5976
|
-
fs2.open = open;
|
|
5977
|
-
function open(path, flags, mode, cb) {
|
|
5978
|
-
if (typeof mode === "function")
|
|
5979
|
-
cb = mode, mode = null;
|
|
5980
|
-
return go$open(path, flags, mode, cb);
|
|
5981
|
-
function go$open(path2, flags2, mode2, cb2, startTime) {
|
|
5982
|
-
return fs$open(path2, flags2, mode2, function(err, fd) {
|
|
5983
|
-
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
5984
|
-
enqueue([go$open, [path2, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
5985
|
-
else {
|
|
5986
|
-
if (typeof cb2 === "function")
|
|
5987
|
-
cb2.apply(this, arguments);
|
|
5988
|
-
}
|
|
5989
|
-
});
|
|
5990
|
-
}
|
|
5991
|
-
}
|
|
5992
|
-
return fs2;
|
|
5993
|
-
}
|
|
5994
|
-
function enqueue(elem) {
|
|
5995
|
-
debug3("ENQUEUE", elem[0].name, elem[1]);
|
|
5996
|
-
fs[gracefulQueue].push(elem);
|
|
5997
|
-
retry();
|
|
5998
|
-
}
|
|
5999
|
-
var retryTimer;
|
|
6000
|
-
function resetQueue() {
|
|
6001
|
-
var now = Date.now();
|
|
6002
|
-
for (var i = 0; i < fs[gracefulQueue].length; ++i) {
|
|
6003
|
-
if (fs[gracefulQueue][i].length > 2) {
|
|
6004
|
-
fs[gracefulQueue][i][3] = now;
|
|
6005
|
-
fs[gracefulQueue][i][4] = now;
|
|
6006
|
-
}
|
|
6007
|
-
}
|
|
6008
|
-
retry();
|
|
6009
|
-
}
|
|
6010
|
-
function retry() {
|
|
6011
|
-
clearTimeout(retryTimer);
|
|
6012
|
-
retryTimer = void 0;
|
|
6013
|
-
if (fs[gracefulQueue].length === 0)
|
|
6014
|
-
return;
|
|
6015
|
-
var elem = fs[gracefulQueue].shift();
|
|
6016
|
-
var fn = elem[0];
|
|
6017
|
-
var args = elem[1];
|
|
6018
|
-
var err = elem[2];
|
|
6019
|
-
var startTime = elem[3];
|
|
6020
|
-
var lastTime = elem[4];
|
|
6021
|
-
if (startTime === void 0) {
|
|
6022
|
-
debug3("RETRY", fn.name, args);
|
|
6023
|
-
fn.apply(null, args);
|
|
6024
|
-
} else if (Date.now() - startTime >= 6e4) {
|
|
6025
|
-
debug3("TIMEOUT", fn.name, args);
|
|
6026
|
-
var cb = args.pop();
|
|
6027
|
-
if (typeof cb === "function")
|
|
6028
|
-
cb.call(null, err);
|
|
6029
|
-
} else {
|
|
6030
|
-
var sinceAttempt = Date.now() - lastTime;
|
|
6031
|
-
var sinceStart = Math.max(lastTime - startTime, 1);
|
|
6032
|
-
var desiredDelay = Math.min(sinceStart * 1.2, 100);
|
|
6033
|
-
if (sinceAttempt >= desiredDelay) {
|
|
6034
|
-
debug3("RETRY", fn.name, args);
|
|
6035
|
-
fn.apply(null, args.concat([startTime]));
|
|
6036
|
-
} else {
|
|
6037
|
-
fs[gracefulQueue].push(elem);
|
|
6038
|
-
}
|
|
6039
|
-
}
|
|
6040
|
-
if (retryTimer === void 0) {
|
|
6041
|
-
retryTimer = setTimeout(retry, 0);
|
|
6042
|
-
}
|
|
6043
|
-
}
|
|
6044
|
-
}
|
|
6045
|
-
});
|
|
6046
|
-
|
|
6047
|
-
// ../../node_modules/.pnpm/jsonfile@4.0.0/node_modules/jsonfile/index.js
|
|
6048
|
-
var require_jsonfile = __commonJS({
|
|
6049
|
-
"../../node_modules/.pnpm/jsonfile@4.0.0/node_modules/jsonfile/index.js"(exports, module2) {
|
|
6050
|
-
var _fs;
|
|
6051
|
-
try {
|
|
6052
|
-
_fs = require_graceful_fs2();
|
|
6053
|
-
} catch (_) {
|
|
6054
|
-
_fs = require("fs");
|
|
6055
|
-
}
|
|
6056
|
-
function readFile2(file, options, callback) {
|
|
6057
|
-
if (callback == null) {
|
|
6058
|
-
callback = options;
|
|
6059
|
-
options = {};
|
|
6060
|
-
}
|
|
6061
|
-
if (typeof options === "string") {
|
|
6062
|
-
options = { encoding: options };
|
|
6063
|
-
}
|
|
6064
|
-
options = options || {};
|
|
6065
|
-
var fs = options.fs || _fs;
|
|
6066
|
-
var shouldThrow = true;
|
|
6067
|
-
if ("throws" in options) {
|
|
6068
|
-
shouldThrow = options.throws;
|
|
6069
|
-
}
|
|
6070
|
-
fs.readFile(file, options, function(err, data) {
|
|
6071
|
-
if (err)
|
|
6072
|
-
return callback(err);
|
|
6073
|
-
data = stripBom(data);
|
|
6074
|
-
var obj;
|
|
6075
|
-
try {
|
|
6076
|
-
obj = JSON.parse(data, options ? options.reviver : null);
|
|
6077
|
-
} catch (err2) {
|
|
6078
|
-
if (shouldThrow) {
|
|
6079
|
-
err2.message = file + ": " + err2.message;
|
|
6080
|
-
return callback(err2);
|
|
6081
|
-
} else {
|
|
6082
|
-
return callback(null, null);
|
|
6083
|
-
}
|
|
6084
|
-
}
|
|
6085
|
-
callback(null, obj);
|
|
6086
|
-
});
|
|
6087
|
-
}
|
|
6088
|
-
function readFileSync(file, options) {
|
|
6089
|
-
options = options || {};
|
|
6090
|
-
if (typeof options === "string") {
|
|
6091
|
-
options = { encoding: options };
|
|
6092
|
-
}
|
|
6093
|
-
var fs = options.fs || _fs;
|
|
6094
|
-
var shouldThrow = true;
|
|
6095
|
-
if ("throws" in options) {
|
|
6096
|
-
shouldThrow = options.throws;
|
|
6097
|
-
}
|
|
6098
|
-
try {
|
|
6099
|
-
var content = fs.readFileSync(file, options);
|
|
6100
|
-
content = stripBom(content);
|
|
6101
|
-
return JSON.parse(content, options.reviver);
|
|
6102
|
-
} catch (err) {
|
|
6103
|
-
if (shouldThrow) {
|
|
6104
|
-
err.message = file + ": " + err.message;
|
|
6105
|
-
throw err;
|
|
6106
|
-
} else {
|
|
6107
|
-
return null;
|
|
5299
|
+
var fs = options.fs || _fs;
|
|
5300
|
+
var shouldThrow = true;
|
|
5301
|
+
if ("throws" in options) {
|
|
5302
|
+
shouldThrow = options.throws;
|
|
5303
|
+
}
|
|
5304
|
+
try {
|
|
5305
|
+
var content = fs.readFileSync(file, options);
|
|
5306
|
+
content = stripBom(content);
|
|
5307
|
+
return JSON.parse(content, options.reviver);
|
|
5308
|
+
} catch (err) {
|
|
5309
|
+
if (shouldThrow) {
|
|
5310
|
+
err.message = file + ": " + err.message;
|
|
5311
|
+
throw err;
|
|
5312
|
+
} else {
|
|
5313
|
+
return null;
|
|
6108
5314
|
}
|
|
6109
5315
|
}
|
|
6110
5316
|
}
|
|
@@ -7759,23 +6965,35 @@ var import_which = __toESM(require_lib2());
|
|
|
7759
6965
|
var import_path = require("path");
|
|
7760
6966
|
var import_semver = __toESM(require_semver2());
|
|
7761
6967
|
var import_build_utils = require("@vercel/build-utils");
|
|
6968
|
+
var RubyVersion = class extends import_build_utils.Version {
|
|
6969
|
+
};
|
|
7762
6970
|
var allOptions = [
|
|
7763
|
-
{
|
|
7764
|
-
|
|
7765
|
-
|
|
6971
|
+
new RubyVersion({
|
|
6972
|
+
major: 3,
|
|
6973
|
+
minor: 3,
|
|
6974
|
+
range: "3.3.x",
|
|
6975
|
+
runtime: "ruby3.3"
|
|
6976
|
+
}),
|
|
6977
|
+
new RubyVersion({
|
|
6978
|
+
major: 3,
|
|
6979
|
+
minor: 2,
|
|
6980
|
+
range: "3.2.x",
|
|
6981
|
+
runtime: "ruby3.2"
|
|
6982
|
+
}),
|
|
6983
|
+
new RubyVersion({
|
|
7766
6984
|
major: 2,
|
|
7767
6985
|
minor: 7,
|
|
7768
6986
|
range: "2.7.x",
|
|
7769
6987
|
runtime: "ruby2.7",
|
|
7770
6988
|
discontinueDate: /* @__PURE__ */ new Date("2023-12-07")
|
|
7771
|
-
},
|
|
7772
|
-
{
|
|
6989
|
+
}),
|
|
6990
|
+
new RubyVersion({
|
|
7773
6991
|
major: 2,
|
|
7774
6992
|
minor: 5,
|
|
7775
6993
|
range: "2.5.x",
|
|
7776
6994
|
runtime: "ruby2.5",
|
|
7777
6995
|
discontinueDate: /* @__PURE__ */ new Date("2021-11-30")
|
|
7778
|
-
}
|
|
6996
|
+
})
|
|
7779
6997
|
];
|
|
7780
6998
|
function getLatestRubyVersion() {
|
|
7781
6999
|
const selection = allOptions.find(isInstalled);
|
|
@@ -7788,10 +7006,6 @@ function getLatestRubyVersion() {
|
|
|
7788
7006
|
}
|
|
7789
7007
|
return selection;
|
|
7790
7008
|
}
|
|
7791
|
-
function isDiscontinued({ discontinueDate }) {
|
|
7792
|
-
const today = Date.now();
|
|
7793
|
-
return discontinueDate !== void 0 && discontinueDate.getTime() <= today;
|
|
7794
|
-
}
|
|
7795
7009
|
function getRubyPath(meta, gemfileContents) {
|
|
7796
7010
|
let selection = getLatestRubyVersion();
|
|
7797
7011
|
if (meta.isDev) {
|
|
@@ -7813,13 +7027,12 @@ function getRubyPath(meta, gemfileContents) {
|
|
|
7813
7027
|
link: "http://vercel.link/ruby-version"
|
|
7814
7028
|
});
|
|
7815
7029
|
}
|
|
7816
|
-
|
|
7817
|
-
if (discontinued || !isInstalled(selection)) {
|
|
7030
|
+
if (selection.state === "discontinued" || !isInstalled(selection)) {
|
|
7818
7031
|
const latest = getLatestRubyVersion();
|
|
7819
|
-
const intro = `Found \`Gemfile\` with ${discontinued ? "discontinued" : "invalid"} Ruby version: \`${line}.\``;
|
|
7032
|
+
const intro = `Found \`Gemfile\` with ${selection.state === "discontinued" ? "discontinued" : "invalid"} Ruby version: \`${line}.\``;
|
|
7820
7033
|
const hint = `Please set \`ruby "~> ${latest.range}"\` in your \`Gemfile\` to use Ruby ${latest.range}.`;
|
|
7821
7034
|
throw new import_build_utils.NowBuildError({
|
|
7822
|
-
code: discontinued ? "RUBY_DISCONTINUED_VERSION" : "RUBY_INVALID_VERSION",
|
|
7035
|
+
code: selection.state === "discontinued" ? "RUBY_DISCONTINUED_VERSION" : "RUBY_INVALID_VERSION",
|
|
7823
7036
|
link: "http://vercel.link/ruby-version",
|
|
7824
7037
|
message: `${intro} ${hint}`
|
|
7825
7038
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/ruby",
|
|
3
3
|
"author": "Nathan Cahill <nathan@nathancahill.com>",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.2.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./dist/index",
|
|
7
7
|
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/ruby",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"@types/fs-extra": "8.0.0",
|
|
19
19
|
"@types/semver": "6.0.0",
|
|
20
20
|
"@types/which": "3.0.0",
|
|
21
|
-
"@vercel/build-utils": "
|
|
21
|
+
"@vercel/build-utils": "9.1.0",
|
|
22
22
|
"execa": "2.0.4",
|
|
23
23
|
"fs-extra": "^7.0.1",
|
|
24
24
|
"jest-junit": "16.0.0",
|