@atlaspack/fs 2.12.1-dev.3478 → 2.12.1-dev.3502
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/lib/browser.js +169 -168
- package/lib/browser.js.map +1 -1
- package/lib/index.js +341 -340
- package/lib/index.js.map +1 -1
- package/package.json +11 -13
- package/src/MemoryFS.js +7 -2
- package/src/NodeFS.js +1 -1
- package/src/NodeVCSAwareFS.js +79 -0
- package/src/OverlayFS.js +1 -1
- package/test/OverlayFS.test.js +1 -1
package/lib/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
var $
|
|
2
|
-
var $
|
|
3
|
-
var $
|
|
4
|
-
var $
|
|
5
|
-
var $
|
|
6
|
-
var $
|
|
7
|
-
var $
|
|
8
|
-
var $
|
|
9
|
-
var $
|
|
10
|
-
var $
|
|
11
|
-
var $
|
|
12
|
-
var $
|
|
13
|
-
var $
|
|
14
|
-
var $
|
|
1
|
+
var $kTI78$path = require("path");
|
|
2
|
+
var $kTI78$stream = require("stream");
|
|
3
|
+
var $kTI78$util = require("util");
|
|
4
|
+
var $kTI78$fs = require("fs");
|
|
5
|
+
var $kTI78$os = require("os");
|
|
6
|
+
var $kTI78$atlaspackbuildcache = require("@atlaspack/build-cache");
|
|
7
|
+
var $kTI78$atlaspackutils = require("@atlaspack/utils");
|
|
8
|
+
var $kTI78$atlaspackfeatureflags = require("@atlaspack/feature-flags");
|
|
9
|
+
var $kTI78$parcelwatcher = require("@parcel/watcher");
|
|
10
|
+
var $kTI78$atlaspackrust = require("@atlaspack/rust");
|
|
11
|
+
var $kTI78$assert = require("assert");
|
|
12
|
+
var $kTI78$constants = require("constants");
|
|
13
|
+
var $kTI78$atlaspackworkers = require("@atlaspack/workers");
|
|
14
|
+
var $kTI78$events = require("events");
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
function $parcel$interopDefault(a) {
|
|
@@ -41,42 +41,42 @@ function $parcel$export(e, n, v, s) {
|
|
|
41
41
|
|
|
42
42
|
var $parcel$global = globalThis;
|
|
43
43
|
|
|
44
|
-
$parcel$export(module.exports, "ncp", () => $
|
|
44
|
+
$parcel$export(module.exports, "ncp", () => $f850a02712c7cafd$export$d3a8044e3fef7335);
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
var $
|
|
48
|
+
var $f8ce570f65ef93a7$exports = {};
|
|
49
49
|
|
|
50
|
-
$parcel$export($
|
|
51
|
-
var $
|
|
50
|
+
$parcel$export($f8ce570f65ef93a7$exports, "NodeFS", () => $f8ce570f65ef93a7$export$c4e0ef2ab73c21e7);
|
|
51
|
+
var $6c064781873e3d07$exports = {};
|
|
52
52
|
|
|
53
|
-
var $
|
|
53
|
+
var $639b403ad792e788$exports = {};
|
|
54
54
|
|
|
55
|
-
var $
|
|
56
|
-
var $
|
|
57
|
-
var $
|
|
55
|
+
var $639b403ad792e788$var$origCwd = process.cwd;
|
|
56
|
+
var $639b403ad792e788$var$cwd = null;
|
|
57
|
+
var $639b403ad792e788$var$platform = process.env.GRACEFUL_FS_PLATFORM || process.platform;
|
|
58
58
|
process.cwd = function() {
|
|
59
|
-
if (!$
|
|
60
|
-
return $
|
|
59
|
+
if (!$639b403ad792e788$var$cwd) $639b403ad792e788$var$cwd = $639b403ad792e788$var$origCwd.call(process);
|
|
60
|
+
return $639b403ad792e788$var$cwd;
|
|
61
61
|
};
|
|
62
62
|
try {
|
|
63
63
|
process.cwd();
|
|
64
64
|
} catch (er) {}
|
|
65
65
|
// This check is needed until node.js 12 is required
|
|
66
66
|
if (typeof process.chdir === 'function') {
|
|
67
|
-
var $
|
|
67
|
+
var $639b403ad792e788$var$chdir = process.chdir;
|
|
68
68
|
process.chdir = function(d) {
|
|
69
|
-
$
|
|
70
|
-
$
|
|
69
|
+
$639b403ad792e788$var$cwd = null;
|
|
70
|
+
$639b403ad792e788$var$chdir.call(process, d);
|
|
71
71
|
};
|
|
72
|
-
if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, $
|
|
72
|
+
if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, $639b403ad792e788$var$chdir);
|
|
73
73
|
}
|
|
74
|
-
$
|
|
75
|
-
function $
|
|
74
|
+
$639b403ad792e788$exports = $639b403ad792e788$var$patch;
|
|
75
|
+
function $639b403ad792e788$var$patch(fs) {
|
|
76
76
|
// (re-)implement some things that are known busted or missing.
|
|
77
77
|
// lchmod, broken prior to 0.6.2
|
|
78
78
|
// back-port the fix here.
|
|
79
|
-
if ($
|
|
79
|
+
if ($kTI78$constants.hasOwnProperty('O_SYMLINK') && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) patchLchmod(fs);
|
|
80
80
|
// lutimes implementation, or no-op
|
|
81
81
|
if (!fs.lutimes) patchLutimes(fs);
|
|
82
82
|
// https://github.com/isaacs/node-graceful-fs/issues/4
|
|
@@ -122,7 +122,7 @@ function $7dfb012429e93f65$var$patch(fs) {
|
|
|
122
122
|
// failures. Also, take care to yield the scheduler. Windows scheduling gives
|
|
123
123
|
// CPU to a busy looping process, which can cause the program causing the lock
|
|
124
124
|
// contention to be starved of CPU by node, so the contention doesn't resolve.
|
|
125
|
-
if ($
|
|
125
|
+
if ($639b403ad792e788$var$platform === "win32") fs.rename = typeof fs.rename !== 'function' ? fs.rename : function(fs$rename) {
|
|
126
126
|
function rename(from, to, cb) {
|
|
127
127
|
var start = Date.now();
|
|
128
128
|
var backoff = 0;
|
|
@@ -179,7 +179,7 @@ function $7dfb012429e93f65$var$patch(fs) {
|
|
|
179
179
|
}(fs.readSync);
|
|
180
180
|
function patchLchmod(fs) {
|
|
181
181
|
fs.lchmod = function(path, mode, callback) {
|
|
182
|
-
fs.open(path, $
|
|
182
|
+
fs.open(path, $kTI78$constants.O_WRONLY | $kTI78$constants.O_SYMLINK, mode, function(err, fd) {
|
|
183
183
|
if (err) {
|
|
184
184
|
if (callback) callback(err);
|
|
185
185
|
return;
|
|
@@ -194,7 +194,7 @@ function $7dfb012429e93f65$var$patch(fs) {
|
|
|
194
194
|
});
|
|
195
195
|
};
|
|
196
196
|
fs.lchmodSync = function(path, mode) {
|
|
197
|
-
var fd = fs.openSync(path, $
|
|
197
|
+
var fd = fs.openSync(path, $kTI78$constants.O_WRONLY | $kTI78$constants.O_SYMLINK, mode);
|
|
198
198
|
// prefer to return the chmod error, if one occurs,
|
|
199
199
|
// but still try to close, and report closing errors if they occur.
|
|
200
200
|
var threw = true;
|
|
@@ -212,9 +212,9 @@ function $7dfb012429e93f65$var$patch(fs) {
|
|
|
212
212
|
};
|
|
213
213
|
}
|
|
214
214
|
function patchLutimes(fs) {
|
|
215
|
-
if ($
|
|
215
|
+
if ($kTI78$constants.hasOwnProperty("O_SYMLINK") && fs.futimes) {
|
|
216
216
|
fs.lutimes = function(path, at, mt, cb) {
|
|
217
|
-
fs.open(path, $
|
|
217
|
+
fs.open(path, $kTI78$constants.O_SYMLINK, function(er, fd) {
|
|
218
218
|
if (er) {
|
|
219
219
|
if (cb) cb(er);
|
|
220
220
|
return;
|
|
@@ -227,7 +227,7 @@ function $7dfb012429e93f65$var$patch(fs) {
|
|
|
227
227
|
});
|
|
228
228
|
};
|
|
229
229
|
fs.lutimesSync = function(path, at, mt) {
|
|
230
|
-
var fd = fs.openSync(path, $
|
|
230
|
+
var fd = fs.openSync(path, $kTI78$constants.O_SYMLINK);
|
|
231
231
|
var ret;
|
|
232
232
|
var threw = true;
|
|
233
233
|
try {
|
|
@@ -342,18 +342,18 @@ function $7dfb012429e93f65$var$patch(fs) {
|
|
|
342
342
|
}
|
|
343
343
|
|
|
344
344
|
|
|
345
|
-
var $
|
|
345
|
+
var $4c0a2d7980621f6a$exports = {};
|
|
346
346
|
|
|
347
|
-
var $
|
|
348
|
-
$
|
|
349
|
-
function $
|
|
347
|
+
var $4c0a2d7980621f6a$require$Stream = $kTI78$stream.Stream;
|
|
348
|
+
$4c0a2d7980621f6a$exports = $4c0a2d7980621f6a$var$legacy;
|
|
349
|
+
function $4c0a2d7980621f6a$var$legacy(fs) {
|
|
350
350
|
return {
|
|
351
351
|
ReadStream: ReadStream,
|
|
352
352
|
WriteStream: WriteStream
|
|
353
353
|
};
|
|
354
354
|
function ReadStream(path, options) {
|
|
355
355
|
if (!(this instanceof ReadStream)) return new ReadStream(path, options);
|
|
356
|
-
$
|
|
356
|
+
$4c0a2d7980621f6a$require$Stream.call(this);
|
|
357
357
|
var self = this;
|
|
358
358
|
this.path = path;
|
|
359
359
|
this.fd = null;
|
|
@@ -396,7 +396,7 @@ function $beafe7e5be87f321$var$legacy(fs) {
|
|
|
396
396
|
}
|
|
397
397
|
function WriteStream(path, options) {
|
|
398
398
|
if (!(this instanceof WriteStream)) return new WriteStream(path, options);
|
|
399
|
-
$
|
|
399
|
+
$4c0a2d7980621f6a$require$Stream.call(this);
|
|
400
400
|
this.path = path;
|
|
401
401
|
this.fd = null;
|
|
402
402
|
this.writable = true;
|
|
@@ -433,16 +433,16 @@ function $beafe7e5be87f321$var$legacy(fs) {
|
|
|
433
433
|
}
|
|
434
434
|
|
|
435
435
|
|
|
436
|
-
var $
|
|
436
|
+
var $0f902c53c0cc1afb$exports = {};
|
|
437
437
|
'use strict';
|
|
438
|
-
$
|
|
439
|
-
var $
|
|
438
|
+
$0f902c53c0cc1afb$exports = $0f902c53c0cc1afb$var$clone;
|
|
439
|
+
var $0f902c53c0cc1afb$var$getPrototypeOf = Object.getPrototypeOf || function(obj) {
|
|
440
440
|
return obj.__proto__;
|
|
441
441
|
};
|
|
442
|
-
function $
|
|
442
|
+
function $0f902c53c0cc1afb$var$clone(obj) {
|
|
443
443
|
if (obj === null || typeof obj !== 'object') return obj;
|
|
444
444
|
if (obj instanceof Object) var copy = {
|
|
445
|
-
__proto__: $
|
|
445
|
+
__proto__: $0f902c53c0cc1afb$var$getPrototypeOf(obj)
|
|
446
446
|
};
|
|
447
447
|
else var copy = Object.create(null);
|
|
448
448
|
Object.getOwnPropertyNames(obj).forEach(function(key) {
|
|
@@ -453,80 +453,80 @@ function $c348b67ed1cdef35$var$clone(obj) {
|
|
|
453
453
|
|
|
454
454
|
|
|
455
455
|
|
|
456
|
-
/* istanbul ignore next - node 0.x polyfill */ var $
|
|
457
|
-
var $
|
|
456
|
+
/* istanbul ignore next - node 0.x polyfill */ var $6c064781873e3d07$var$gracefulQueue;
|
|
457
|
+
var $6c064781873e3d07$var$previousSymbol;
|
|
458
458
|
/* istanbul ignore else - node 0.x polyfill */ if (typeof Symbol === 'function' && typeof Symbol.for === 'function') {
|
|
459
|
-
$
|
|
459
|
+
$6c064781873e3d07$var$gracefulQueue = Symbol.for('graceful-fs.queue');
|
|
460
460
|
// This is used in testing by future versions
|
|
461
|
-
$
|
|
461
|
+
$6c064781873e3d07$var$previousSymbol = Symbol.for('graceful-fs.previous');
|
|
462
462
|
} else {
|
|
463
|
-
$
|
|
464
|
-
$
|
|
463
|
+
$6c064781873e3d07$var$gracefulQueue = '___graceful-fs.queue';
|
|
464
|
+
$6c064781873e3d07$var$previousSymbol = '___graceful-fs.previous';
|
|
465
465
|
}
|
|
466
|
-
function $
|
|
467
|
-
function $
|
|
468
|
-
Object.defineProperty(context, $
|
|
466
|
+
function $6c064781873e3d07$var$noop() {}
|
|
467
|
+
function $6c064781873e3d07$var$publishQueue(context, queue) {
|
|
468
|
+
Object.defineProperty(context, $6c064781873e3d07$var$gracefulQueue, {
|
|
469
469
|
get: function() {
|
|
470
470
|
return queue;
|
|
471
471
|
}
|
|
472
472
|
});
|
|
473
473
|
}
|
|
474
|
-
var $
|
|
475
|
-
if ($
|
|
476
|
-
else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) $
|
|
477
|
-
var m = $
|
|
474
|
+
var $6c064781873e3d07$var$debug = $6c064781873e3d07$var$noop;
|
|
475
|
+
if ($kTI78$util.debuglog) $6c064781873e3d07$var$debug = $kTI78$util.debuglog('gfs4');
|
|
476
|
+
else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) $6c064781873e3d07$var$debug = function() {
|
|
477
|
+
var m = $kTI78$util.format.apply($kTI78$util, arguments);
|
|
478
478
|
m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ');
|
|
479
479
|
console.error(m);
|
|
480
480
|
};
|
|
481
481
|
|
|
482
482
|
// Once time initialization
|
|
483
|
-
if (!$
|
|
483
|
+
if (!$kTI78$fs[$6c064781873e3d07$var$gracefulQueue]) {
|
|
484
484
|
// This queue can be shared by multiple loaded instances
|
|
485
|
-
var $
|
|
486
|
-
$
|
|
485
|
+
var $6c064781873e3d07$var$queue = $parcel$global[$6c064781873e3d07$var$gracefulQueue] || [];
|
|
486
|
+
$6c064781873e3d07$var$publishQueue($kTI78$fs, $6c064781873e3d07$var$queue);
|
|
487
487
|
// Patch fs.close/closeSync to shared queue version, because we need
|
|
488
488
|
// to retry() whenever a close happens *anywhere* in the program.
|
|
489
489
|
// This is essential when multiple graceful-fs instances are
|
|
490
490
|
// in play at the same time.
|
|
491
|
-
$
|
|
491
|
+
$kTI78$fs.close = function(fs$close) {
|
|
492
492
|
function close(fd, cb) {
|
|
493
|
-
return fs$close.call($
|
|
493
|
+
return fs$close.call($kTI78$fs, fd, function(err) {
|
|
494
494
|
// This function uses the graceful-fs shared queue
|
|
495
|
-
if (!err) $
|
|
495
|
+
if (!err) $6c064781873e3d07$var$resetQueue();
|
|
496
496
|
if (typeof cb === 'function') cb.apply(this, arguments);
|
|
497
497
|
});
|
|
498
498
|
}
|
|
499
|
-
Object.defineProperty(close, $
|
|
499
|
+
Object.defineProperty(close, $6c064781873e3d07$var$previousSymbol, {
|
|
500
500
|
value: fs$close
|
|
501
501
|
});
|
|
502
502
|
return close;
|
|
503
|
-
}($
|
|
504
|
-
$
|
|
503
|
+
}($kTI78$fs.close);
|
|
504
|
+
$kTI78$fs.closeSync = function(fs$closeSync) {
|
|
505
505
|
function closeSync(fd) {
|
|
506
506
|
// This function uses the graceful-fs shared queue
|
|
507
|
-
fs$closeSync.apply($
|
|
508
|
-
$
|
|
507
|
+
fs$closeSync.apply($kTI78$fs, arguments);
|
|
508
|
+
$6c064781873e3d07$var$resetQueue();
|
|
509
509
|
}
|
|
510
|
-
Object.defineProperty(closeSync, $
|
|
510
|
+
Object.defineProperty(closeSync, $6c064781873e3d07$var$previousSymbol, {
|
|
511
511
|
value: fs$closeSync
|
|
512
512
|
});
|
|
513
513
|
return closeSync;
|
|
514
|
-
}($
|
|
514
|
+
}($kTI78$fs.closeSync);
|
|
515
515
|
if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) process.on('exit', function() {
|
|
516
|
-
$
|
|
517
|
-
$
|
|
516
|
+
$6c064781873e3d07$var$debug($kTI78$fs[$6c064781873e3d07$var$gracefulQueue]);
|
|
517
|
+
$kTI78$assert.equal($kTI78$fs[$6c064781873e3d07$var$gracefulQueue].length, 0);
|
|
518
518
|
});
|
|
519
519
|
}
|
|
520
|
-
if (!$parcel$global[$
|
|
521
|
-
$
|
|
522
|
-
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !$
|
|
523
|
-
$
|
|
524
|
-
$
|
|
520
|
+
if (!$parcel$global[$6c064781873e3d07$var$gracefulQueue]) $6c064781873e3d07$var$publishQueue($parcel$global, $kTI78$fs[$6c064781873e3d07$var$gracefulQueue]);
|
|
521
|
+
$6c064781873e3d07$exports = $6c064781873e3d07$var$patch($0f902c53c0cc1afb$exports($kTI78$fs));
|
|
522
|
+
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !$kTI78$fs.__patched) {
|
|
523
|
+
$6c064781873e3d07$exports = $6c064781873e3d07$var$patch($kTI78$fs);
|
|
524
|
+
$kTI78$fs.__patched = true;
|
|
525
525
|
}
|
|
526
|
-
function $
|
|
526
|
+
function $6c064781873e3d07$var$patch(fs) {
|
|
527
527
|
// Everything that references the open() function needs to be in here
|
|
528
|
-
$
|
|
529
|
-
fs.gracefulify = $
|
|
528
|
+
$639b403ad792e788$exports(fs);
|
|
529
|
+
fs.gracefulify = $6c064781873e3d07$var$patch;
|
|
530
530
|
fs.createReadStream = createReadStream;
|
|
531
531
|
fs.createWriteStream = createWriteStream;
|
|
532
532
|
var fs$readFile = fs.readFile;
|
|
@@ -536,7 +536,7 @@ function $c9fef47dc93720ea$var$patch(fs) {
|
|
|
536
536
|
return go$readFile(path, options, cb);
|
|
537
537
|
function go$readFile(path, options, cb, startTime) {
|
|
538
538
|
return fs$readFile(path, options, function(err) {
|
|
539
|
-
if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) $
|
|
539
|
+
if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) $6c064781873e3d07$var$enqueue([
|
|
540
540
|
go$readFile,
|
|
541
541
|
[
|
|
542
542
|
path,
|
|
@@ -558,7 +558,7 @@ function $c9fef47dc93720ea$var$patch(fs) {
|
|
|
558
558
|
return go$writeFile(path, data, options, cb);
|
|
559
559
|
function go$writeFile(path, data, options, cb, startTime) {
|
|
560
560
|
return fs$writeFile(path, data, options, function(err) {
|
|
561
|
-
if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) $
|
|
561
|
+
if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) $6c064781873e3d07$var$enqueue([
|
|
562
562
|
go$writeFile,
|
|
563
563
|
[
|
|
564
564
|
path,
|
|
@@ -581,7 +581,7 @@ function $c9fef47dc93720ea$var$patch(fs) {
|
|
|
581
581
|
return go$appendFile(path, data, options, cb);
|
|
582
582
|
function go$appendFile(path, data, options, cb, startTime) {
|
|
583
583
|
return fs$appendFile(path, data, options, function(err) {
|
|
584
|
-
if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) $
|
|
584
|
+
if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) $6c064781873e3d07$var$enqueue([
|
|
585
585
|
go$appendFile,
|
|
586
586
|
[
|
|
587
587
|
path,
|
|
@@ -607,7 +607,7 @@ function $c9fef47dc93720ea$var$patch(fs) {
|
|
|
607
607
|
return go$copyFile(src, dest, flags, cb);
|
|
608
608
|
function go$copyFile(src, dest, flags, cb, startTime) {
|
|
609
609
|
return fs$copyFile(src, dest, flags, function(err) {
|
|
610
|
-
if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) $
|
|
610
|
+
if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) $6c064781873e3d07$var$enqueue([
|
|
611
611
|
go$copyFile,
|
|
612
612
|
[
|
|
613
613
|
src,
|
|
@@ -636,7 +636,7 @@ function $c9fef47dc93720ea$var$patch(fs) {
|
|
|
636
636
|
return go$readdir(path, options, cb);
|
|
637
637
|
function fs$readdirCallback(path, options, cb, startTime) {
|
|
638
638
|
return function(err, files) {
|
|
639
|
-
if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) $
|
|
639
|
+
if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) $6c064781873e3d07$var$enqueue([
|
|
640
640
|
go$readdir,
|
|
641
641
|
[
|
|
642
642
|
path,
|
|
@@ -655,7 +655,7 @@ function $c9fef47dc93720ea$var$patch(fs) {
|
|
|
655
655
|
}
|
|
656
656
|
}
|
|
657
657
|
if (process.version.substr(0, 4) === 'v0.8') {
|
|
658
|
-
var legStreams = $
|
|
658
|
+
var legStreams = $4c0a2d7980621f6a$exports(fs);
|
|
659
659
|
ReadStream = legStreams.ReadStream;
|
|
660
660
|
WriteStream = legStreams.WriteStream;
|
|
661
661
|
}
|
|
@@ -758,7 +758,7 @@ function $c9fef47dc93720ea$var$patch(fs) {
|
|
|
758
758
|
return go$open(path, flags, mode, cb);
|
|
759
759
|
function go$open(path, flags, mode, cb, startTime) {
|
|
760
760
|
return fs$open(path, flags, mode, function(err, fd) {
|
|
761
|
-
if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) $
|
|
761
|
+
if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) $6c064781873e3d07$var$enqueue([
|
|
762
762
|
go$open,
|
|
763
763
|
[
|
|
764
764
|
path,
|
|
@@ -776,35 +776,35 @@ function $c9fef47dc93720ea$var$patch(fs) {
|
|
|
776
776
|
}
|
|
777
777
|
return fs;
|
|
778
778
|
}
|
|
779
|
-
function $
|
|
780
|
-
$
|
|
781
|
-
$
|
|
782
|
-
$
|
|
779
|
+
function $6c064781873e3d07$var$enqueue(elem) {
|
|
780
|
+
$6c064781873e3d07$var$debug('ENQUEUE', elem[0].name, elem[1]);
|
|
781
|
+
$kTI78$fs[$6c064781873e3d07$var$gracefulQueue].push(elem);
|
|
782
|
+
$6c064781873e3d07$var$retry();
|
|
783
783
|
}
|
|
784
784
|
// keep track of the timeout between retry() calls
|
|
785
|
-
var $
|
|
785
|
+
var $6c064781873e3d07$var$retryTimer;
|
|
786
786
|
// reset the startTime and lastTime to now
|
|
787
787
|
// this resets the start of the 60 second overall timeout as well as the
|
|
788
788
|
// delay between attempts so that we'll retry these jobs sooner
|
|
789
|
-
function $
|
|
789
|
+
function $6c064781873e3d07$var$resetQueue() {
|
|
790
790
|
var now = Date.now();
|
|
791
|
-
for(var i = 0; i < $
|
|
791
|
+
for(var i = 0; i < $kTI78$fs[$6c064781873e3d07$var$gracefulQueue].length; ++i)// entries that are only a length of 2 are from an older version, don't
|
|
792
792
|
// bother modifying those since they'll be retried anyway.
|
|
793
|
-
if ($
|
|
794
|
-
$
|
|
793
|
+
if ($kTI78$fs[$6c064781873e3d07$var$gracefulQueue][i].length > 2) {
|
|
794
|
+
$kTI78$fs[$6c064781873e3d07$var$gracefulQueue][i][3] = now // startTime
|
|
795
795
|
;
|
|
796
|
-
$
|
|
796
|
+
$kTI78$fs[$6c064781873e3d07$var$gracefulQueue][i][4] = now // lastTime
|
|
797
797
|
;
|
|
798
798
|
}
|
|
799
799
|
// call retry to make sure we're actively processing the queue
|
|
800
|
-
$
|
|
800
|
+
$6c064781873e3d07$var$retry();
|
|
801
801
|
}
|
|
802
|
-
function $
|
|
802
|
+
function $6c064781873e3d07$var$retry() {
|
|
803
803
|
// clear the timer and remove it to help prevent unintended concurrency
|
|
804
|
-
clearTimeout($
|
|
805
|
-
$
|
|
806
|
-
if ($
|
|
807
|
-
var elem = $
|
|
804
|
+
clearTimeout($6c064781873e3d07$var$retryTimer);
|
|
805
|
+
$6c064781873e3d07$var$retryTimer = undefined;
|
|
806
|
+
if ($kTI78$fs[$6c064781873e3d07$var$gracefulQueue].length === 0) return;
|
|
807
|
+
var elem = $kTI78$fs[$6c064781873e3d07$var$gracefulQueue].shift();
|
|
808
808
|
var fn = elem[0];
|
|
809
809
|
var args = elem[1];
|
|
810
810
|
// these items may be unset if they were added by an older graceful-fs
|
|
@@ -814,11 +814,11 @@ function $c9fef47dc93720ea$var$retry() {
|
|
|
814
814
|
// if we don't have a startTime we have no way of knowing if we've waited
|
|
815
815
|
// long enough, so go ahead and retry this item now
|
|
816
816
|
if (startTime === undefined) {
|
|
817
|
-
$
|
|
817
|
+
$6c064781873e3d07$var$debug('RETRY', fn.name, args);
|
|
818
818
|
fn.apply(null, args);
|
|
819
819
|
} else if (Date.now() - startTime >= 60000) {
|
|
820
820
|
// it's been more than 60 seconds total, bail now
|
|
821
|
-
$
|
|
821
|
+
$6c064781873e3d07$var$debug('TIMEOUT', fn.name, args);
|
|
822
822
|
var cb = args.pop();
|
|
823
823
|
if (typeof cb === 'function') cb.call(null, err);
|
|
824
824
|
} else {
|
|
@@ -832,32 +832,32 @@ function $c9fef47dc93720ea$var$retry() {
|
|
|
832
832
|
var desiredDelay = Math.min(sinceStart * 1.2, 100);
|
|
833
833
|
// it's been long enough since the last retry, do it again
|
|
834
834
|
if (sinceAttempt >= desiredDelay) {
|
|
835
|
-
$
|
|
835
|
+
$6c064781873e3d07$var$debug('RETRY', fn.name, args);
|
|
836
836
|
fn.apply(null, args.concat([
|
|
837
837
|
startTime
|
|
838
838
|
]));
|
|
839
839
|
} else // if we can't do this job yet, push it to the end of the queue
|
|
840
840
|
// and let the next iteration check again
|
|
841
|
-
$
|
|
841
|
+
$kTI78$fs[$6c064781873e3d07$var$gracefulQueue].push(elem);
|
|
842
842
|
}
|
|
843
843
|
// schedule our next run if one isn't already scheduled
|
|
844
|
-
if ($
|
|
844
|
+
if ($6c064781873e3d07$var$retryTimer === undefined) $6c064781873e3d07$var$retryTimer = setTimeout($6c064781873e3d07$var$retry, 0);
|
|
845
845
|
}
|
|
846
846
|
|
|
847
847
|
|
|
848
848
|
|
|
849
|
-
var $
|
|
849
|
+
var $591958858326883b$exports = {};
|
|
850
850
|
|
|
851
851
|
|
|
852
|
-
$
|
|
853
|
-
$
|
|
854
|
-
function $
|
|
852
|
+
$591958858326883b$exports = $591958858326883b$var$ncp;
|
|
853
|
+
$591958858326883b$var$ncp.ncp = $591958858326883b$var$ncp;
|
|
854
|
+
function $591958858326883b$var$ncp(source, dest, options, callback) {
|
|
855
855
|
var cback = callback;
|
|
856
856
|
if (!callback) {
|
|
857
857
|
cback = options;
|
|
858
858
|
options = {};
|
|
859
859
|
}
|
|
860
|
-
var basePath = process.cwd(), currentPath = $
|
|
860
|
+
var basePath = process.cwd(), currentPath = $kTI78$path.resolve(basePath, source), targetPath = $kTI78$path.resolve(basePath, dest), filter = options.filter, rename = options.rename, transform = options.transform, clobber = options.clobber !== false, modified = options.modified, dereference = options.dereference, errs = null, started = 0, finished = 0, running = 0, limit = options.limit || $591958858326883b$var$ncp.limit || 16;
|
|
861
861
|
limit = limit < 1 ? 1 : limit > 512 ? 512 : limit;
|
|
862
862
|
startCopy(currentPath);
|
|
863
863
|
function startCopy(source) {
|
|
@@ -872,7 +872,7 @@ function $2eff50cbbfc18abd$var$ncp(source, dest, options, callback) {
|
|
|
872
872
|
return getStats(source);
|
|
873
873
|
}
|
|
874
874
|
function getStats(source) {
|
|
875
|
-
var stat = dereference ? $
|
|
875
|
+
var stat = dereference ? $kTI78$fs.stat : $kTI78$fs.lstat;
|
|
876
876
|
if (running >= limit) return setImmediate(function() {
|
|
877
877
|
getStats(source);
|
|
878
878
|
});
|
|
@@ -900,7 +900,7 @@ function $2eff50cbbfc18abd$var$ncp(source, dest, options, callback) {
|
|
|
900
900
|
copyFile(file, target);
|
|
901
901
|
});
|
|
902
902
|
if (modified) {
|
|
903
|
-
var stat = dereference ? $
|
|
903
|
+
var stat = dereference ? $kTI78$fs.stat : $kTI78$fs.lstat;
|
|
904
904
|
stat(target, function(err, stats) {
|
|
905
905
|
//if souce modified time greater to target modified time copy file
|
|
906
906
|
if (file.mtime.getTime() > stats.mtime.getTime()) copyFile(file, target);
|
|
@@ -910,7 +910,7 @@ function $2eff50cbbfc18abd$var$ncp(source, dest, options, callback) {
|
|
|
910
910
|
});
|
|
911
911
|
}
|
|
912
912
|
function copyFile(file, target) {
|
|
913
|
-
var readStream = $
|
|
913
|
+
var readStream = $kTI78$fs.createReadStream(file.name), writeStream = $kTI78$fs.createWriteStream(target, {
|
|
914
914
|
mode: file.mode
|
|
915
915
|
});
|
|
916
916
|
readStream.on('error', onError);
|
|
@@ -922,13 +922,13 @@ function $2eff50cbbfc18abd$var$ncp(source, dest, options, callback) {
|
|
|
922
922
|
writeStream.once('finish', function() {
|
|
923
923
|
if (modified) {
|
|
924
924
|
//target file modified date sync.
|
|
925
|
-
$
|
|
925
|
+
$kTI78$fs.utimesSync(target, file.atime, file.mtime);
|
|
926
926
|
cb();
|
|
927
927
|
} else cb();
|
|
928
928
|
});
|
|
929
929
|
}
|
|
930
930
|
function rmFile(file, done) {
|
|
931
|
-
$
|
|
931
|
+
$kTI78$fs.unlink(file, function(err) {
|
|
932
932
|
if (err) return onError(err);
|
|
933
933
|
return done();
|
|
934
934
|
});
|
|
@@ -941,34 +941,34 @@ function $2eff50cbbfc18abd$var$ncp(source, dest, options, callback) {
|
|
|
941
941
|
});
|
|
942
942
|
}
|
|
943
943
|
function mkDir(dir, target) {
|
|
944
|
-
$
|
|
944
|
+
$kTI78$fs.mkdir(target, dir.mode, function(err) {
|
|
945
945
|
if (err) return onError(err);
|
|
946
946
|
copyDir(dir.name);
|
|
947
947
|
});
|
|
948
948
|
}
|
|
949
949
|
function copyDir(dir) {
|
|
950
|
-
$
|
|
950
|
+
$kTI78$fs.readdir(dir, function(err, items) {
|
|
951
951
|
if (err) return onError(err);
|
|
952
952
|
items.forEach(function(item) {
|
|
953
|
-
startCopy($
|
|
953
|
+
startCopy($kTI78$path.join(dir, item));
|
|
954
954
|
});
|
|
955
955
|
return cb();
|
|
956
956
|
});
|
|
957
957
|
}
|
|
958
958
|
function onLink(link) {
|
|
959
959
|
var target = link.replace(currentPath, targetPath);
|
|
960
|
-
$
|
|
960
|
+
$kTI78$fs.readlink(link, function(err, resolvedPath) {
|
|
961
961
|
if (err) return onError(err);
|
|
962
962
|
checkLink(resolvedPath, target);
|
|
963
963
|
});
|
|
964
964
|
}
|
|
965
965
|
function checkLink(resolvedPath, target) {
|
|
966
|
-
if (dereference) resolvedPath = $
|
|
966
|
+
if (dereference) resolvedPath = $kTI78$path.resolve(basePath, resolvedPath);
|
|
967
967
|
isWritable(target, function(writable) {
|
|
968
968
|
if (writable) return makeLink(resolvedPath, target);
|
|
969
|
-
$
|
|
969
|
+
$kTI78$fs.readlink(target, function(err, targetDest) {
|
|
970
970
|
if (err) return onError(err);
|
|
971
|
-
if (dereference) targetDest = $
|
|
971
|
+
if (dereference) targetDest = $kTI78$path.resolve(basePath, targetDest);
|
|
972
972
|
if (targetDest === resolvedPath) return cb();
|
|
973
973
|
return rmFile(target, function() {
|
|
974
974
|
makeLink(resolvedPath, target);
|
|
@@ -977,13 +977,13 @@ function $2eff50cbbfc18abd$var$ncp(source, dest, options, callback) {
|
|
|
977
977
|
});
|
|
978
978
|
}
|
|
979
979
|
function makeLink(linkPath, target) {
|
|
980
|
-
$
|
|
980
|
+
$kTI78$fs.symlink(linkPath, target, function(err) {
|
|
981
981
|
if (err) return onError(err);
|
|
982
982
|
return cb();
|
|
983
983
|
});
|
|
984
984
|
}
|
|
985
985
|
function isWritable(path, done) {
|
|
986
|
-
$
|
|
986
|
+
$kTI78$fs.lstat(path, function(err) {
|
|
987
987
|
if (err) {
|
|
988
988
|
if (err.code === 'ENOENT') return done(true);
|
|
989
989
|
return done(false);
|
|
@@ -993,7 +993,7 @@ function $2eff50cbbfc18abd$var$ncp(source, dest, options, callback) {
|
|
|
993
993
|
}
|
|
994
994
|
function onError(err) {
|
|
995
995
|
if (options.stopOnError) return cback(err);
|
|
996
|
-
else if (!errs && options.errs) errs = $
|
|
996
|
+
else if (!errs && options.errs) errs = $kTI78$fs.createWriteStream(options.errs);
|
|
997
997
|
else if (!errs) errs = [];
|
|
998
998
|
if (typeof errs.write === 'undefined') errs.push(err);
|
|
999
999
|
else errs.write(err.stack + '\n\n');
|
|
@@ -1016,36 +1016,36 @@ function $2eff50cbbfc18abd$var$ncp(source, dest, options, callback) {
|
|
|
1016
1016
|
|
|
1017
1017
|
|
|
1018
1018
|
|
|
1019
|
-
var $
|
|
1020
|
-
$
|
|
1019
|
+
var $eac1f2f4592d0c44$exports = {};
|
|
1020
|
+
$eac1f2f4592d0c44$exports = JSON.parse("{\"name\":\"@atlaspack/fs\",\"version\":\"2.12.1-dev.3502+c2daeab5a\",\"description\":\"Blazing fast, zero configuration web application bundler\",\"license\":\"(MIT OR Apache-2.0)\",\"publishConfig\":{\"access\":\"public\"},\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/atlassian-labs/atlaspack.git\"},\"main\":\"lib/index.js\",\"source\":\"src/index.js\",\"types\":\"index.d.ts\",\"engines\":{\"node\":\">= 16.0.0\"},\"targets\":{\"types\":false,\"main\":{\"includeNodeModules\":{\"@atlaspack/build-cache\":false,\"@atlaspack/feature-flags\":false,\"@atlaspack/rust\":false,\"@atlaspack/types-internal\":false,\"@atlaspack/utils\":false,\"@atlaspack/watcher-watchman-js\":false,\"@parcel/watcher\":false,\"@atlaspack/workers\":false}},\"browser\":{\"includeNodeModules\":{\"@atlaspack/build-cache\":false,\"@atlaspack/feature-flags\":false,\"@atlaspack/rust\":false,\"@atlaspack/types-internal\":false,\"@atlaspack/utils\":false,\"@atlaspack/watcher-watchman-js\":false,\"@parcel/watcher\":false,\"@atlaspack/workers\":false}}},\"scripts\":{\"build-ts\":\"mkdir -p lib && flow-to-ts src/types.js > lib/types.d.ts\",\"check-ts\":\"tsc --noEmit index.d.ts\"},\"dependencies\":{\"@atlaspack/build-cache\":\"2.12.1-dev.3502+c2daeab5a\",\"@atlaspack/feature-flags\":\"2.12.1-dev.3502+c2daeab5a\",\"@atlaspack/rust\":\"2.12.1-dev.3502+c2daeab5a\",\"@atlaspack/types-internal\":\"2.12.1-dev.3502+c2daeab5a\",\"@atlaspack/utils\":\"2.12.1-dev.3502+c2daeab5a\",\"@atlaspack/workers\":\"2.12.1-dev.3502+c2daeab5a\",\"@parcel/watcher\":\"^2.0.7\"},\"devDependencies\":{\"@atlaspack/watcher-watchman-js\":\"2.12.1-dev.3502+c2daeab5a\",\"graceful-fs\":\"^4.2.4\",\"ncp\":\"^2.0.0\",\"nullthrows\":\"^1.1.1\",\"utility-types\":\"^3.10.0\"},\"browser\":{\"@atlaspack/fs\":\"./lib/browser.js\",\"./src/NodeFS.js\":\"./src/NodeFS.browser.js\"},\"gitHead\":\"c2daeab5a12461903159dec34df5671eaaa9b749\"}");
|
|
1021
1021
|
|
|
1022
1022
|
|
|
1023
1023
|
|
|
1024
1024
|
|
|
1025
|
-
function $
|
|
1026
|
-
let { root: root } = (0, ($parcel$interopDefault($
|
|
1025
|
+
function $d65482e6541f1ac9$export$4c6d088a7d7f9947(fs, moduleName, dir) {
|
|
1026
|
+
let { root: root } = (0, ($parcel$interopDefault($kTI78$path))).parse(dir);
|
|
1027
1027
|
while(dir !== root){
|
|
1028
1028
|
// Skip node_modules directories
|
|
1029
|
-
if ((0, ($parcel$interopDefault($
|
|
1029
|
+
if ((0, ($parcel$interopDefault($kTI78$path))).basename(dir) === 'node_modules') dir = (0, ($parcel$interopDefault($kTI78$path))).dirname(dir);
|
|
1030
1030
|
try {
|
|
1031
|
-
let moduleDir = (0, ($parcel$interopDefault($
|
|
1031
|
+
let moduleDir = (0, ($parcel$interopDefault($kTI78$path))).join(dir, 'node_modules', moduleName);
|
|
1032
1032
|
let stats = fs.statSync(moduleDir);
|
|
1033
1033
|
if (stats.isDirectory()) return moduleDir;
|
|
1034
1034
|
} catch (err) {
|
|
1035
1035
|
// ignore
|
|
1036
1036
|
}
|
|
1037
1037
|
// Move up a directory
|
|
1038
|
-
dir = (0, ($parcel$interopDefault($
|
|
1038
|
+
dir = (0, ($parcel$interopDefault($kTI78$path))).dirname(dir);
|
|
1039
1039
|
}
|
|
1040
1040
|
return null;
|
|
1041
1041
|
}
|
|
1042
|
-
function $
|
|
1043
|
-
let { root: pathRoot } = (0, ($parcel$interopDefault($
|
|
1042
|
+
function $d65482e6541f1ac9$export$d51a93c758976388(fs, fileNames, dir, root) {
|
|
1043
|
+
let { root: pathRoot } = (0, ($parcel$interopDefault($kTI78$path))).parse(dir);
|
|
1044
1044
|
// eslint-disable-next-line no-constant-condition
|
|
1045
1045
|
while(true){
|
|
1046
|
-
if ((0, ($parcel$interopDefault($
|
|
1046
|
+
if ((0, ($parcel$interopDefault($kTI78$path))).basename(dir) === 'node_modules') return null;
|
|
1047
1047
|
for (const fileName of fileNames){
|
|
1048
|
-
let filePath = (0, ($parcel$interopDefault($
|
|
1048
|
+
let filePath = (0, ($parcel$interopDefault($kTI78$path))).join(dir, fileName);
|
|
1049
1049
|
try {
|
|
1050
1050
|
if (fs.statSync(filePath).isFile()) return filePath;
|
|
1051
1051
|
} catch (err) {
|
|
@@ -1053,11 +1053,11 @@ function $ac65417502ef89d5$export$d51a93c758976388(fs, fileNames, dir, root) {
|
|
|
1053
1053
|
}
|
|
1054
1054
|
}
|
|
1055
1055
|
if (dir === root || dir === pathRoot) break;
|
|
1056
|
-
dir = (0, ($parcel$interopDefault($
|
|
1056
|
+
dir = (0, ($parcel$interopDefault($kTI78$path))).dirname(dir);
|
|
1057
1057
|
}
|
|
1058
1058
|
return null;
|
|
1059
1059
|
}
|
|
1060
|
-
function $
|
|
1060
|
+
function $d65482e6541f1ac9$export$64df6e3182fd5b2d(fs, filePaths) {
|
|
1061
1061
|
for (let filePath of filePaths)try {
|
|
1062
1062
|
if (fs.statSync(filePath).isFile()) return filePath;
|
|
1063
1063
|
} catch (err) {
|
|
@@ -1068,9 +1068,9 @@ function $ac65417502ef89d5$export$64df6e3182fd5b2d(fs, filePaths) {
|
|
|
1068
1068
|
|
|
1069
1069
|
// Most of this can go away once we only support Node 10+, which includes
|
|
1070
1070
|
// require('fs').promises
|
|
1071
|
-
const $
|
|
1072
|
-
const $
|
|
1073
|
-
function $
|
|
1071
|
+
const $f8ce570f65ef93a7$var$realpath = (0, $kTI78$util.promisify)(process.platform === 'win32' ? (0, (/*@__PURE__*/$parcel$interopDefault($6c064781873e3d07$exports))).realpath : (0, (/*@__PURE__*/$parcel$interopDefault($6c064781873e3d07$exports))).realpath.native);
|
|
1072
|
+
const $f8ce570f65ef93a7$var$isPnP = process.versions.pnp != null;
|
|
1073
|
+
function $f8ce570f65ef93a7$var$getWatchmanWatcher() {
|
|
1074
1074
|
// This is here to trick atlaspack into ignoring this require...
|
|
1075
1075
|
const packageName = [
|
|
1076
1076
|
'@atlaspack',
|
|
@@ -1079,54 +1079,54 @@ function $c384d5a91630ebac$var$getWatchmanWatcher() {
|
|
|
1079
1079
|
// $FlowFixMe
|
|
1080
1080
|
return require(packageName);
|
|
1081
1081
|
}
|
|
1082
|
-
class $
|
|
1083
|
-
readFile = (0, $
|
|
1084
|
-
copyFile = (0, $
|
|
1085
|
-
stat = (0, $
|
|
1086
|
-
readdir = (0, $
|
|
1087
|
-
symlink = (0, $
|
|
1088
|
-
unlink = (0, $
|
|
1089
|
-
utimes = (0, $
|
|
1090
|
-
ncp = (0, $
|
|
1091
|
-
createReadStream = (0, (/*@__PURE__*/$parcel$interopDefault($
|
|
1082
|
+
class $f8ce570f65ef93a7$export$c4e0ef2ab73c21e7 {
|
|
1083
|
+
readFile = (0, $kTI78$util.promisify)((0, (/*@__PURE__*/$parcel$interopDefault($6c064781873e3d07$exports))).readFile);
|
|
1084
|
+
copyFile = (0, $kTI78$util.promisify)((0, (/*@__PURE__*/$parcel$interopDefault($6c064781873e3d07$exports))).copyFile);
|
|
1085
|
+
stat = (0, $kTI78$util.promisify)((0, (/*@__PURE__*/$parcel$interopDefault($6c064781873e3d07$exports))).stat);
|
|
1086
|
+
readdir = (0, $kTI78$util.promisify)((0, (/*@__PURE__*/$parcel$interopDefault($6c064781873e3d07$exports))).readdir);
|
|
1087
|
+
symlink = (0, $kTI78$util.promisify)((0, (/*@__PURE__*/$parcel$interopDefault($6c064781873e3d07$exports))).symlink);
|
|
1088
|
+
unlink = (0, $kTI78$util.promisify)((0, (/*@__PURE__*/$parcel$interopDefault($6c064781873e3d07$exports))).unlink);
|
|
1089
|
+
utimes = (0, $kTI78$util.promisify)((0, (/*@__PURE__*/$parcel$interopDefault($6c064781873e3d07$exports))).utimes);
|
|
1090
|
+
ncp = (0, $kTI78$util.promisify)((0, (/*@__PURE__*/$parcel$interopDefault($591958858326883b$exports))));
|
|
1091
|
+
createReadStream = (0, (/*@__PURE__*/$parcel$interopDefault($6c064781873e3d07$exports))).createReadStream;
|
|
1092
1092
|
cwd = ()=>process.cwd();
|
|
1093
1093
|
chdir = (directory)=>process.chdir(directory);
|
|
1094
|
-
statSync = (path)=>(0, (/*@__PURE__*/$parcel$interopDefault($
|
|
1095
|
-
realpathSync = process.platform === 'win32' ? (0, (/*@__PURE__*/$parcel$interopDefault($
|
|
1096
|
-
existsSync = (0, (/*@__PURE__*/$parcel$interopDefault($
|
|
1097
|
-
readdirSync = (0, (/*@__PURE__*/$parcel$interopDefault($
|
|
1098
|
-
findAncestorFile = $
|
|
1099
|
-
findNodeModule = $
|
|
1100
|
-
findFirstFile = $
|
|
1094
|
+
statSync = (path)=>(0, (/*@__PURE__*/$parcel$interopDefault($6c064781873e3d07$exports))).statSync(path);
|
|
1095
|
+
realpathSync = process.platform === 'win32' ? (0, (/*@__PURE__*/$parcel$interopDefault($6c064781873e3d07$exports))).realpathSync : (0, (/*@__PURE__*/$parcel$interopDefault($6c064781873e3d07$exports))).realpathSync.native;
|
|
1096
|
+
existsSync = (0, (/*@__PURE__*/$parcel$interopDefault($6c064781873e3d07$exports))).existsSync;
|
|
1097
|
+
readdirSync = (0, (/*@__PURE__*/$parcel$interopDefault($6c064781873e3d07$exports))).readdirSync;
|
|
1098
|
+
findAncestorFile = $f8ce570f65ef93a7$var$isPnP ? (...args)=>$d65482e6541f1ac9$export$d51a93c758976388(this, ...args) : $kTI78$atlaspackrust.findAncestorFile;
|
|
1099
|
+
findNodeModule = $f8ce570f65ef93a7$var$isPnP ? (...args)=>$d65482e6541f1ac9$export$4c6d088a7d7f9947(this, ...args) : $kTI78$atlaspackrust.findNodeModule;
|
|
1100
|
+
findFirstFile = $f8ce570f65ef93a7$var$isPnP ? (...args)=>$d65482e6541f1ac9$export$64df6e3182fd5b2d(this, ...args) : $kTI78$atlaspackrust.findFirstFile;
|
|
1101
1101
|
watcher() {
|
|
1102
|
-
return (0, $
|
|
1102
|
+
return (0, $kTI78$atlaspackfeatureflags.getFeatureFlag)('useWatchmanWatcher') ? $f8ce570f65ef93a7$var$getWatchmanWatcher() : (0, ($parcel$interopDefault($kTI78$parcelwatcher)));
|
|
1103
1103
|
}
|
|
1104
1104
|
createWriteStream(filePath, options) {
|
|
1105
1105
|
// Make createWriteStream atomic
|
|
1106
|
-
let tmpFilePath = $
|
|
1106
|
+
let tmpFilePath = $f8ce570f65ef93a7$var$getTempFilePath(filePath);
|
|
1107
1107
|
let failed = false;
|
|
1108
1108
|
const move = async ()=>{
|
|
1109
1109
|
if (!failed) try {
|
|
1110
|
-
await (0, (/*@__PURE__*/$parcel$interopDefault($
|
|
1110
|
+
await (0, (/*@__PURE__*/$parcel$interopDefault($6c064781873e3d07$exports))).promises.rename(tmpFilePath, filePath);
|
|
1111
1111
|
} catch (e) {
|
|
1112
1112
|
// This is adapted from fs-write-stream-atomic. Apparently
|
|
1113
1113
|
// Windows doesn't like renaming when the target already exists.
|
|
1114
1114
|
if (process.platform === 'win32' && e.syscall && e.syscall === 'rename' && e.code && e.code === 'EPERM') {
|
|
1115
1115
|
let [hashTmp, hashTarget] = await Promise.all([
|
|
1116
|
-
(0, $
|
|
1117
|
-
(0, $
|
|
1116
|
+
(0, $kTI78$atlaspackutils.hashFile)(this, tmpFilePath),
|
|
1117
|
+
(0, $kTI78$atlaspackutils.hashFile)(this, filePath)
|
|
1118
1118
|
]);
|
|
1119
1119
|
await this.unlink(tmpFilePath);
|
|
1120
1120
|
if (hashTmp != hashTarget) throw e;
|
|
1121
1121
|
}
|
|
1122
1122
|
}
|
|
1123
1123
|
};
|
|
1124
|
-
let writeStream = (0, (/*@__PURE__*/$parcel$interopDefault($
|
|
1124
|
+
let writeStream = (0, (/*@__PURE__*/$parcel$interopDefault($6c064781873e3d07$exports))).createWriteStream(tmpFilePath, {
|
|
1125
1125
|
...options,
|
|
1126
1126
|
fs: {
|
|
1127
|
-
...(0, (/*@__PURE__*/$parcel$interopDefault($
|
|
1127
|
+
...(0, (/*@__PURE__*/$parcel$interopDefault($6c064781873e3d07$exports))),
|
|
1128
1128
|
close: (fd, cb)=>{
|
|
1129
|
-
(0, (/*@__PURE__*/$parcel$interopDefault($
|
|
1129
|
+
(0, (/*@__PURE__*/$parcel$interopDefault($6c064781873e3d07$exports))).close(fd, (err)=>{
|
|
1130
1130
|
if (err) cb(err);
|
|
1131
1131
|
else move().then(()=>cb(), (err)=>cb(err));
|
|
1132
1132
|
});
|
|
@@ -1135,22 +1135,22 @@ class $c384d5a91630ebac$export$c4e0ef2ab73c21e7 {
|
|
|
1135
1135
|
});
|
|
1136
1136
|
writeStream.once('error', ()=>{
|
|
1137
1137
|
failed = true;
|
|
1138
|
-
(0, (/*@__PURE__*/$parcel$interopDefault($
|
|
1138
|
+
(0, (/*@__PURE__*/$parcel$interopDefault($6c064781873e3d07$exports))).unlinkSync(tmpFilePath);
|
|
1139
1139
|
});
|
|
1140
1140
|
return writeStream;
|
|
1141
1141
|
}
|
|
1142
1142
|
async writeFile(filePath, contents, options) {
|
|
1143
|
-
let tmpFilePath = $
|
|
1144
|
-
await (0, (/*@__PURE__*/$parcel$interopDefault($
|
|
1145
|
-
await (0, (/*@__PURE__*/$parcel$interopDefault($
|
|
1143
|
+
let tmpFilePath = $f8ce570f65ef93a7$var$getTempFilePath(filePath);
|
|
1144
|
+
await (0, (/*@__PURE__*/$parcel$interopDefault($6c064781873e3d07$exports))).promises.writeFile(tmpFilePath, contents, options);
|
|
1145
|
+
await (0, (/*@__PURE__*/$parcel$interopDefault($6c064781873e3d07$exports))).promises.rename(tmpFilePath, filePath);
|
|
1146
1146
|
}
|
|
1147
1147
|
readFileSync(filePath, encoding) {
|
|
1148
|
-
if (encoding != null) return (0, (/*@__PURE__*/$parcel$interopDefault($
|
|
1149
|
-
return (0, (/*@__PURE__*/$parcel$interopDefault($
|
|
1148
|
+
if (encoding != null) return (0, (/*@__PURE__*/$parcel$interopDefault($6c064781873e3d07$exports))).readFileSync(filePath, encoding);
|
|
1149
|
+
return (0, (/*@__PURE__*/$parcel$interopDefault($6c064781873e3d07$exports))).readFileSync(filePath);
|
|
1150
1150
|
}
|
|
1151
1151
|
async realpath(originalPath) {
|
|
1152
1152
|
try {
|
|
1153
|
-
return await $
|
|
1153
|
+
return await $f8ce570f65ef93a7$var$realpath(originalPath, 'utf8');
|
|
1154
1154
|
} catch (e) {
|
|
1155
1155
|
// do nothing
|
|
1156
1156
|
}
|
|
@@ -1158,7 +1158,7 @@ class $c384d5a91630ebac$export$c4e0ef2ab73c21e7 {
|
|
|
1158
1158
|
}
|
|
1159
1159
|
exists(filePath) {
|
|
1160
1160
|
return new Promise((resolve)=>{
|
|
1161
|
-
(0, (/*@__PURE__*/$parcel$interopDefault($
|
|
1161
|
+
(0, (/*@__PURE__*/$parcel$interopDefault($6c064781873e3d07$exports))).exists(filePath, resolve);
|
|
1162
1162
|
});
|
|
1163
1163
|
}
|
|
1164
1164
|
watch(dir, fn, opts) {
|
|
@@ -1171,19 +1171,19 @@ class $c384d5a91630ebac$export$c4e0ef2ab73c21e7 {
|
|
|
1171
1171
|
await this.watcher().writeSnapshot(dir, snapshot, opts);
|
|
1172
1172
|
}
|
|
1173
1173
|
static deserialize() {
|
|
1174
|
-
return new $
|
|
1174
|
+
return new $f8ce570f65ef93a7$export$c4e0ef2ab73c21e7();
|
|
1175
1175
|
}
|
|
1176
1176
|
serialize() {
|
|
1177
1177
|
return null;
|
|
1178
1178
|
}
|
|
1179
1179
|
async mkdirp(filePath) {
|
|
1180
|
-
await (0, ($parcel$interopDefault($
|
|
1180
|
+
await (0, ($parcel$interopDefault($kTI78$fs))).promises.mkdir(filePath, {
|
|
1181
1181
|
recursive: true
|
|
1182
1182
|
});
|
|
1183
1183
|
}
|
|
1184
1184
|
async rimraf(filePath) {
|
|
1185
|
-
if ((0, (/*@__PURE__*/$parcel$interopDefault($
|
|
1186
|
-
await (0, (/*@__PURE__*/$parcel$interopDefault($
|
|
1185
|
+
if ((0, (/*@__PURE__*/$parcel$interopDefault($6c064781873e3d07$exports))).promises.rm) {
|
|
1186
|
+
await (0, (/*@__PURE__*/$parcel$interopDefault($6c064781873e3d07$exports))).promises.rm(filePath, {
|
|
1187
1187
|
recursive: true,
|
|
1188
1188
|
force: true
|
|
1189
1189
|
});
|
|
@@ -1197,117 +1197,117 @@ class $c384d5a91630ebac$export$c4e0ef2ab73c21e7 {
|
|
|
1197
1197
|
return;
|
|
1198
1198
|
}
|
|
1199
1199
|
if (stat.isDirectory()) // $FlowFixMe
|
|
1200
|
-
await (0, ($parcel$interopDefault($
|
|
1200
|
+
await (0, ($parcel$interopDefault($kTI78$fs))).promises.rmdir(filePath, {
|
|
1201
1201
|
recursive: true
|
|
1202
1202
|
});
|
|
1203
|
-
else await (0, ($parcel$interopDefault($
|
|
1203
|
+
else await (0, ($parcel$interopDefault($kTI78$fs))).promises.unlink(filePath);
|
|
1204
1204
|
}
|
|
1205
1205
|
}
|
|
1206
|
-
(0, $
|
|
1207
|
-
let $
|
|
1208
|
-
let $
|
|
1206
|
+
(0, $kTI78$atlaspackbuildcache.registerSerializableClass)(`${(0, (/*@__PURE__*/$parcel$interopDefault($eac1f2f4592d0c44$exports))).version}:NodeFS`, $f8ce570f65ef93a7$export$c4e0ef2ab73c21e7);
|
|
1207
|
+
let $f8ce570f65ef93a7$var$writeStreamCalls = 0;
|
|
1208
|
+
let $f8ce570f65ef93a7$var$threadId;
|
|
1209
1209
|
|
|
1210
1210
|
try {
|
|
1211
|
-
({ threadId: $
|
|
1211
|
+
({ threadId: $f8ce570f65ef93a7$var$threadId } = $f8ce570f65ef93a7$import$9c2ae04019a9b9e3);
|
|
1212
1212
|
} catch {
|
|
1213
1213
|
//
|
|
1214
1214
|
}
|
|
1215
|
-
let $
|
|
1216
|
-
function $
|
|
1217
|
-
if ($
|
|
1215
|
+
let $f8ce570f65ef93a7$var$useOsTmpDir;
|
|
1216
|
+
function $f8ce570f65ef93a7$var$shouldUseOsTmpDir(filePath) {
|
|
1217
|
+
if ($f8ce570f65ef93a7$var$useOsTmpDir != null) return $f8ce570f65ef93a7$var$useOsTmpDir;
|
|
1218
1218
|
try {
|
|
1219
|
-
const tmpDir = (0, $
|
|
1220
|
-
(0, ($parcel$interopDefault($
|
|
1221
|
-
const tmpDirStats = (0, ($parcel$interopDefault($
|
|
1222
|
-
const filePathStats = (0, ($parcel$interopDefault($
|
|
1219
|
+
const tmpDir = (0, $kTI78$os.tmpdir)();
|
|
1220
|
+
(0, ($parcel$interopDefault($kTI78$fs))).accessSync(tmpDir, (0, ($parcel$interopDefault($kTI78$fs))).constants.R_OK | (0, ($parcel$interopDefault($kTI78$fs))).constants.W_OK);
|
|
1221
|
+
const tmpDirStats = (0, ($parcel$interopDefault($kTI78$fs))).statSync(tmpDir);
|
|
1222
|
+
const filePathStats = (0, ($parcel$interopDefault($kTI78$fs))).statSync(filePath);
|
|
1223
1223
|
// Check the tmpdir is on the same partition as the target directory.
|
|
1224
1224
|
// This is required to ensure renaming is an atomic operation.
|
|
1225
|
-
$
|
|
1225
|
+
$f8ce570f65ef93a7$var$useOsTmpDir = tmpDirStats.dev === filePathStats.dev;
|
|
1226
1226
|
} catch (e) {
|
|
1227
1227
|
// We don't have read/write access to the OS tmp directory
|
|
1228
|
-
$
|
|
1228
|
+
$f8ce570f65ef93a7$var$useOsTmpDir = false;
|
|
1229
1229
|
}
|
|
1230
|
-
return $
|
|
1230
|
+
return $f8ce570f65ef93a7$var$useOsTmpDir;
|
|
1231
1231
|
}
|
|
1232
1232
|
// Generate a temporary file path used for atomic writing of files.
|
|
1233
|
-
function $
|
|
1234
|
-
$
|
|
1233
|
+
function $f8ce570f65ef93a7$var$getTempFilePath(filePath) {
|
|
1234
|
+
$f8ce570f65ef93a7$var$writeStreamCalls = $f8ce570f65ef93a7$var$writeStreamCalls % Number.MAX_SAFE_INTEGER;
|
|
1235
1235
|
let tmpFilePath = filePath;
|
|
1236
1236
|
// If possible, write the tmp file to the OS tmp directory
|
|
1237
1237
|
// This reduces the amount of FS events the watcher needs to process during the build
|
|
1238
|
-
if ($
|
|
1239
|
-
return tmpFilePath + '.' + process.pid + ($
|
|
1238
|
+
if ($f8ce570f65ef93a7$var$shouldUseOsTmpDir(filePath)) tmpFilePath = (0, ($parcel$interopDefault($kTI78$path))).join((0, $kTI78$os.tmpdir)(), (0, ($parcel$interopDefault($kTI78$path))).basename(filePath));
|
|
1239
|
+
return tmpFilePath + '.' + process.pid + ($f8ce570f65ef93a7$var$threadId != null ? '.' + $f8ce570f65ef93a7$var$threadId : '') + '.' + ($f8ce570f65ef93a7$var$writeStreamCalls++).toString(36);
|
|
1240
1240
|
}
|
|
1241
1241
|
|
|
1242
1242
|
|
|
1243
|
-
var $
|
|
1243
|
+
var $7a85d2e5bcd45e92$exports = {};
|
|
1244
1244
|
|
|
1245
|
-
$parcel$export($
|
|
1246
|
-
$parcel$export($
|
|
1247
|
-
$parcel$export($
|
|
1248
|
-
$parcel$export($
|
|
1245
|
+
$parcel$export($7a85d2e5bcd45e92$exports, "MemoryFS", () => $7a85d2e5bcd45e92$export$3048eb7ec07c2c4e);
|
|
1246
|
+
$parcel$export($7a85d2e5bcd45e92$exports, "FSError", () => $7a85d2e5bcd45e92$export$d414276624ebf134);
|
|
1247
|
+
$parcel$export($7a85d2e5bcd45e92$exports, "makeShared", () => $7a85d2e5bcd45e92$export$df9eb3e75aa27a22);
|
|
1248
|
+
$parcel$export($7a85d2e5bcd45e92$exports, "File", () => $7a85d2e5bcd45e92$export$b6afa8811b7e644e);
|
|
1249
1249
|
|
|
1250
1250
|
|
|
1251
1251
|
|
|
1252
1252
|
|
|
1253
1253
|
|
|
1254
1254
|
|
|
1255
|
-
var $
|
|
1255
|
+
var $3c6f2cb8f8e5311c$exports = {};
|
|
1256
1256
|
'use strict';
|
|
1257
|
-
function $
|
|
1257
|
+
function $3c6f2cb8f8e5311c$var$nullthrows(x, message) {
|
|
1258
1258
|
if (x != null) return x;
|
|
1259
1259
|
var error = new Error(message !== undefined ? message : 'Got unexpected ' + x);
|
|
1260
1260
|
error.framesToPop = 1; // Skip nullthrows's own stack frame.
|
|
1261
1261
|
throw error;
|
|
1262
1262
|
}
|
|
1263
|
-
$
|
|
1264
|
-
$
|
|
1265
|
-
Object.defineProperty($
|
|
1263
|
+
$3c6f2cb8f8e5311c$exports = $3c6f2cb8f8e5311c$var$nullthrows;
|
|
1264
|
+
$3c6f2cb8f8e5311c$exports.default = $3c6f2cb8f8e5311c$var$nullthrows;
|
|
1265
|
+
Object.defineProperty($3c6f2cb8f8e5311c$exports, '__esModule', {
|
|
1266
1266
|
value: true
|
|
1267
1267
|
});
|
|
1268
1268
|
|
|
1269
1269
|
|
|
1270
1270
|
|
|
1271
1271
|
|
|
1272
|
-
const $
|
|
1273
|
-
let $
|
|
1274
|
-
class $
|
|
1272
|
+
const $7a85d2e5bcd45e92$var$instances = new Map();
|
|
1273
|
+
let $7a85d2e5bcd45e92$var$id = 0;
|
|
1274
|
+
class $7a85d2e5bcd45e92$export$3048eb7ec07c2c4e {
|
|
1275
1275
|
_numWorkerInstances = 0;
|
|
1276
1276
|
_workerRegisterResolves = [];
|
|
1277
|
-
_emitter = new (0, ($parcel$interopDefault($
|
|
1277
|
+
_emitter = new (0, ($parcel$interopDefault($kTI78$events)))();
|
|
1278
1278
|
constructor(workerFarm){
|
|
1279
1279
|
this.farm = workerFarm;
|
|
1280
|
-
this._cwd = (0, ($parcel$interopDefault($
|
|
1280
|
+
this._cwd = (0, ($parcel$interopDefault($kTI78$path))).resolve((0, ($parcel$interopDefault($kTI78$path))).sep);
|
|
1281
1281
|
this.dirs = new Map([
|
|
1282
1282
|
[
|
|
1283
1283
|
this._cwd,
|
|
1284
|
-
new $
|
|
1284
|
+
new $7a85d2e5bcd45e92$var$Directory()
|
|
1285
1285
|
]
|
|
1286
1286
|
]);
|
|
1287
1287
|
this.files = new Map();
|
|
1288
1288
|
this.symlinks = new Map();
|
|
1289
1289
|
this.watchers = new Map();
|
|
1290
1290
|
this.events = [];
|
|
1291
|
-
this.id = $
|
|
1291
|
+
this.id = $7a85d2e5bcd45e92$var$id++;
|
|
1292
1292
|
this._workerHandles = [];
|
|
1293
1293
|
this._eventQueue = [];
|
|
1294
|
-
$
|
|
1294
|
+
$7a85d2e5bcd45e92$var$instances.set(this.id, this);
|
|
1295
1295
|
this._emitter.on('allWorkersRegistered', ()=>{
|
|
1296
1296
|
for (let resolve of this._workerRegisterResolves)resolve();
|
|
1297
1297
|
this._workerRegisterResolves = [];
|
|
1298
1298
|
});
|
|
1299
1299
|
}
|
|
1300
1300
|
static deserialize(opts) {
|
|
1301
|
-
let existing = $
|
|
1301
|
+
let existing = $7a85d2e5bcd45e92$var$instances.get(opts.id);
|
|
1302
1302
|
if (existing != null) {
|
|
1303
1303
|
// Correct the count of worker instances since serialization assumes a new instance is created
|
|
1304
|
-
(0, ($parcel$interopDefault($
|
|
1304
|
+
(0, ($parcel$interopDefault($kTI78$atlaspackworkers))).getWorkerApi().runHandle(opts.handle, [
|
|
1305
1305
|
'decrementWorkerInstance',
|
|
1306
1306
|
[]
|
|
1307
1307
|
]);
|
|
1308
1308
|
return existing;
|
|
1309
1309
|
}
|
|
1310
|
-
let fs = new $
|
|
1310
|
+
let fs = new $7a85d2e5bcd45e92$var$WorkerFS(opts.id, (0, (/*@__PURE__*/$parcel$interopDefault($3c6f2cb8f8e5311c$exports)))(opts.handle));
|
|
1311
1311
|
fs.dirs = opts.dirs;
|
|
1312
1312
|
fs.files = opts.files;
|
|
1313
1313
|
fs.symlinks = opts.symlinks;
|
|
@@ -1340,15 +1340,15 @@ class $b04b349429406f05$export$3048eb7ec07c2c4e {
|
|
|
1340
1340
|
this._cwd = dir;
|
|
1341
1341
|
}
|
|
1342
1342
|
_normalizePath(filePath, realpath = true) {
|
|
1343
|
-
filePath = (0, ($parcel$interopDefault($
|
|
1344
|
-
if (!filePath.startsWith(this.cwd())) filePath = (0, ($parcel$interopDefault($
|
|
1343
|
+
filePath = (0, ($parcel$interopDefault($kTI78$path))).normalize(filePath);
|
|
1344
|
+
if (!filePath.startsWith(this.cwd())) filePath = (0, ($parcel$interopDefault($kTI78$path))).resolve(this.cwd(), filePath);
|
|
1345
1345
|
// get realpath by following symlinks
|
|
1346
1346
|
if (realpath) {
|
|
1347
|
-
let { root: root, dir: dir, base: base } = (0, ($parcel$interopDefault($
|
|
1348
|
-
let parts = dir.slice(root.length).split((0, ($parcel$interopDefault($
|
|
1347
|
+
let { root: root, dir: dir, base: base } = (0, ($parcel$interopDefault($kTI78$path))).parse(filePath);
|
|
1348
|
+
let parts = dir.slice(root.length).split((0, ($parcel$interopDefault($kTI78$path))).sep).concat(base);
|
|
1349
1349
|
let res = root;
|
|
1350
1350
|
for (let part of parts){
|
|
1351
|
-
res = (0, ($parcel$interopDefault($
|
|
1351
|
+
res = (0, ($parcel$interopDefault($kTI78$path))).join(res, part);
|
|
1352
1352
|
let symlink = this.symlinks.get(res);
|
|
1353
1353
|
if (symlink) res = symlink;
|
|
1354
1354
|
}
|
|
@@ -1358,16 +1358,16 @@ class $b04b349429406f05$export$3048eb7ec07c2c4e {
|
|
|
1358
1358
|
}
|
|
1359
1359
|
async writeFile(filePath, contents, options) {
|
|
1360
1360
|
filePath = this._normalizePath(filePath);
|
|
1361
|
-
if (this.dirs.has(filePath)) throw new $
|
|
1362
|
-
let dir = (0, ($parcel$interopDefault($
|
|
1363
|
-
if (!this.dirs.has(dir)) throw new $
|
|
1364
|
-
let buffer = $
|
|
1361
|
+
if (this.dirs.has(filePath)) throw new $7a85d2e5bcd45e92$export$d414276624ebf134('EISDIR', filePath, 'is a directory');
|
|
1362
|
+
let dir = (0, ($parcel$interopDefault($kTI78$path))).dirname(filePath);
|
|
1363
|
+
if (!this.dirs.has(dir)) throw new $7a85d2e5bcd45e92$export$d414276624ebf134('ENOENT', dir, 'does not exist');
|
|
1364
|
+
let buffer = $7a85d2e5bcd45e92$export$df9eb3e75aa27a22(contents);
|
|
1365
1365
|
let file = this.files.get(filePath);
|
|
1366
1366
|
let mode = options && options.mode || 438;
|
|
1367
1367
|
if (file) {
|
|
1368
1368
|
file.write(buffer, mode);
|
|
1369
1369
|
this.files.set(filePath, file);
|
|
1370
|
-
} else this.files.set(filePath, new $
|
|
1370
|
+
} else this.files.set(filePath, new $7a85d2e5bcd45e92$export$b6afa8811b7e644e(buffer, mode));
|
|
1371
1371
|
await this._sendWorkerEvent({
|
|
1372
1372
|
type: 'writeFile',
|
|
1373
1373
|
path: filePath,
|
|
@@ -1385,7 +1385,7 @@ class $b04b349429406f05$export$3048eb7ec07c2c4e {
|
|
|
1385
1385
|
readFileSync(filePath, encoding) {
|
|
1386
1386
|
filePath = this._normalizePath(filePath);
|
|
1387
1387
|
let file = this.files.get(filePath);
|
|
1388
|
-
if (file == null) throw new $
|
|
1388
|
+
if (file == null) throw new $7a85d2e5bcd45e92$export$d414276624ebf134('ENOENT', filePath, 'does not exist');
|
|
1389
1389
|
let buffer = file.read();
|
|
1390
1390
|
if (encoding) return buffer.toString(encoding);
|
|
1391
1391
|
return buffer;
|
|
@@ -1399,7 +1399,7 @@ class $b04b349429406f05$export$3048eb7ec07c2c4e {
|
|
|
1399
1399
|
let dir = this.dirs.get(filePath);
|
|
1400
1400
|
if (dir) return dir.stat();
|
|
1401
1401
|
let file = this.files.get(filePath);
|
|
1402
|
-
if (file == null) throw new $
|
|
1402
|
+
if (file == null) throw new $7a85d2e5bcd45e92$export$d414276624ebf134('ENOENT', filePath, 'does not exist');
|
|
1403
1403
|
return file.stat();
|
|
1404
1404
|
}
|
|
1405
1405
|
// eslint-disable-next-line require-await
|
|
@@ -1408,26 +1408,26 @@ class $b04b349429406f05$export$3048eb7ec07c2c4e {
|
|
|
1408
1408
|
}
|
|
1409
1409
|
readdirSync(dir, opts) {
|
|
1410
1410
|
dir = this._normalizePath(dir);
|
|
1411
|
-
if (!this.dirs.has(dir)) throw new $
|
|
1412
|
-
if (!dir.endsWith((0, ($parcel$interopDefault($
|
|
1411
|
+
if (!this.dirs.has(dir)) throw new $7a85d2e5bcd45e92$export$d414276624ebf134('ENOENT', dir, 'does not exist');
|
|
1412
|
+
if (!dir.endsWith((0, ($parcel$interopDefault($kTI78$path))).sep)) dir += (0, ($parcel$interopDefault($kTI78$path))).sep;
|
|
1413
1413
|
let res = [];
|
|
1414
1414
|
for (let [filePath, entry] of this.dirs){
|
|
1415
1415
|
if (filePath === dir) continue;
|
|
1416
|
-
if (filePath.startsWith(dir) && filePath.indexOf((0, ($parcel$interopDefault($
|
|
1416
|
+
if (filePath.startsWith(dir) && filePath.indexOf((0, ($parcel$interopDefault($kTI78$path))).sep, dir.length) === -1) {
|
|
1417
1417
|
let name = filePath.slice(dir.length);
|
|
1418
|
-
if (opts?.withFileTypes) res.push(new $
|
|
1418
|
+
if (opts?.withFileTypes) res.push(new $7a85d2e5bcd45e92$var$Dirent(name, entry));
|
|
1419
1419
|
else res.push(name);
|
|
1420
1420
|
}
|
|
1421
1421
|
}
|
|
1422
|
-
for (let [filePath, entry] of this.files)if (filePath.startsWith(dir) && filePath.indexOf((0, ($parcel$interopDefault($
|
|
1422
|
+
for (let [filePath, entry] of this.files)if (filePath.startsWith(dir) && filePath.indexOf((0, ($parcel$interopDefault($kTI78$path))).sep, dir.length) === -1) {
|
|
1423
1423
|
let name = filePath.slice(dir.length);
|
|
1424
|
-
if (opts?.withFileTypes) res.push(new $
|
|
1424
|
+
if (opts?.withFileTypes) res.push(new $7a85d2e5bcd45e92$var$Dirent(name, entry));
|
|
1425
1425
|
else res.push(name);
|
|
1426
1426
|
}
|
|
1427
|
-
for (let [from] of this.symlinks)if (from.startsWith(dir) && from.indexOf((0, ($parcel$interopDefault($
|
|
1427
|
+
for (let [from] of this.symlinks)if (from.startsWith(dir) && from.indexOf((0, ($parcel$interopDefault($kTI78$path))).sep, dir.length) === -1) {
|
|
1428
1428
|
let name = from.slice(dir.length);
|
|
1429
|
-
if (opts?.withFileTypes) res.push(new $
|
|
1430
|
-
mode: $
|
|
1429
|
+
if (opts?.withFileTypes) res.push(new $7a85d2e5bcd45e92$var$Dirent(name, {
|
|
1430
|
+
mode: $7a85d2e5bcd45e92$var$S_IFLNK
|
|
1431
1431
|
}));
|
|
1432
1432
|
else res.push(name);
|
|
1433
1433
|
}
|
|
@@ -1439,7 +1439,7 @@ class $b04b349429406f05$export$3048eb7ec07c2c4e {
|
|
|
1439
1439
|
}
|
|
1440
1440
|
async unlink(filePath) {
|
|
1441
1441
|
filePath = this._normalizePath(filePath);
|
|
1442
|
-
if (!this.files.has(filePath) && !this.dirs.has(filePath)) throw new $
|
|
1442
|
+
if (!this.files.has(filePath) && !this.dirs.has(filePath)) throw new $7a85d2e5bcd45e92$export$d414276624ebf134('ENOENT', filePath, 'does not exist');
|
|
1443
1443
|
this.files.delete(filePath);
|
|
1444
1444
|
this.dirs.delete(filePath);
|
|
1445
1445
|
this.watchers.delete(filePath);
|
|
@@ -1456,11 +1456,11 @@ class $b04b349429406f05$export$3048eb7ec07c2c4e {
|
|
|
1456
1456
|
async mkdirp(dir) {
|
|
1457
1457
|
dir = this._normalizePath(dir);
|
|
1458
1458
|
if (this.dirs.has(dir)) return Promise.resolve();
|
|
1459
|
-
if (this.files.has(dir)) throw new $
|
|
1460
|
-
let root = (0, ($parcel$interopDefault($
|
|
1459
|
+
if (this.files.has(dir)) throw new $7a85d2e5bcd45e92$export$d414276624ebf134('ENOENT', dir, 'is not a directory');
|
|
1460
|
+
let root = (0, ($parcel$interopDefault($kTI78$path))).parse(dir).root;
|
|
1461
1461
|
while(dir !== root){
|
|
1462
1462
|
if (this.dirs.has(dir)) break;
|
|
1463
|
-
this.dirs.set(dir, new $
|
|
1463
|
+
this.dirs.set(dir, new $7a85d2e5bcd45e92$var$Directory());
|
|
1464
1464
|
await this._sendWorkerEvent({
|
|
1465
1465
|
type: 'mkdir',
|
|
1466
1466
|
path: dir
|
|
@@ -1469,14 +1469,14 @@ class $b04b349429406f05$export$3048eb7ec07c2c4e {
|
|
|
1469
1469
|
type: 'create',
|
|
1470
1470
|
path: dir
|
|
1471
1471
|
});
|
|
1472
|
-
dir = (0, ($parcel$interopDefault($
|
|
1472
|
+
dir = (0, ($parcel$interopDefault($kTI78$path))).dirname(dir);
|
|
1473
1473
|
}
|
|
1474
1474
|
return Promise.resolve();
|
|
1475
1475
|
}
|
|
1476
1476
|
async rimraf(filePath) {
|
|
1477
1477
|
filePath = this._normalizePath(filePath);
|
|
1478
1478
|
if (this.dirs.has(filePath)) {
|
|
1479
|
-
let dir = filePath + (0, ($parcel$interopDefault($
|
|
1479
|
+
let dir = filePath + (0, ($parcel$interopDefault($kTI78$path))).sep;
|
|
1480
1480
|
for (let filePath of this.files.keys())if (filePath.startsWith(dir)) {
|
|
1481
1481
|
this.files.delete(filePath);
|
|
1482
1482
|
await this._sendWorkerEvent({
|
|
@@ -1533,7 +1533,7 @@ class $b04b349429406f05$export$3048eb7ec07c2c4e {
|
|
|
1533
1533
|
source = this._normalizePath(source);
|
|
1534
1534
|
if (this.dirs.has(source)) {
|
|
1535
1535
|
if (!this.dirs.has(destination)) {
|
|
1536
|
-
this.dirs.set(destination, new $
|
|
1536
|
+
this.dirs.set(destination, new $7a85d2e5bcd45e92$var$Directory());
|
|
1537
1537
|
await this._sendWorkerEvent({
|
|
1538
1538
|
type: 'mkdir',
|
|
1539
1539
|
path: destination
|
|
@@ -1543,11 +1543,11 @@ class $b04b349429406f05$export$3048eb7ec07c2c4e {
|
|
|
1543
1543
|
path: destination
|
|
1544
1544
|
});
|
|
1545
1545
|
}
|
|
1546
|
-
let dir = source + (0, ($parcel$interopDefault($
|
|
1546
|
+
let dir = source + (0, ($parcel$interopDefault($kTI78$path))).sep;
|
|
1547
1547
|
for (let dirPath of this.dirs.keys())if (dirPath.startsWith(dir)) {
|
|
1548
|
-
let destName = (0, ($parcel$interopDefault($
|
|
1548
|
+
let destName = (0, ($parcel$interopDefault($kTI78$path))).join(destination, dirPath.slice(dir.length));
|
|
1549
1549
|
if (!this.dirs.has(destName)) {
|
|
1550
|
-
this.dirs.set(destName, new $
|
|
1550
|
+
this.dirs.set(destName, new $7a85d2e5bcd45e92$var$Directory());
|
|
1551
1551
|
await this._sendWorkerEvent({
|
|
1552
1552
|
type: 'mkdir',
|
|
1553
1553
|
path: destination
|
|
@@ -1559,7 +1559,7 @@ class $b04b349429406f05$export$3048eb7ec07c2c4e {
|
|
|
1559
1559
|
}
|
|
1560
1560
|
}
|
|
1561
1561
|
for (let [filePath, file] of this.files)if (filePath.startsWith(dir)) {
|
|
1562
|
-
let destName = (0, ($parcel$interopDefault($
|
|
1562
|
+
let destName = (0, ($parcel$interopDefault($kTI78$path))).join(destination, filePath.slice(dir.length));
|
|
1563
1563
|
let exists = this.files.has(destName);
|
|
1564
1564
|
this.files.set(destName, file);
|
|
1565
1565
|
await this._sendWorkerEvent({
|
|
@@ -1575,10 +1575,10 @@ class $b04b349429406f05$export$3048eb7ec07c2c4e {
|
|
|
1575
1575
|
} else await this.copyFile(source, destination);
|
|
1576
1576
|
}
|
|
1577
1577
|
createReadStream(filePath) {
|
|
1578
|
-
return new $
|
|
1578
|
+
return new $7a85d2e5bcd45e92$var$ReadStream(this, filePath);
|
|
1579
1579
|
}
|
|
1580
1580
|
createWriteStream(filePath, options) {
|
|
1581
|
-
return new $
|
|
1581
|
+
return new $7a85d2e5bcd45e92$var$WriteStream(this, filePath, options);
|
|
1582
1582
|
}
|
|
1583
1583
|
realpathSync(filePath) {
|
|
1584
1584
|
return this._normalizePath(filePath);
|
|
@@ -1615,7 +1615,7 @@ class $b04b349429406f05$export$3048eb7ec07c2c4e {
|
|
|
1615
1615
|
let events = this._eventQueue;
|
|
1616
1616
|
this._eventQueue = [];
|
|
1617
1617
|
for (let [dir, watchers] of this.watchers){
|
|
1618
|
-
if (!dir.endsWith((0, ($parcel$interopDefault($
|
|
1618
|
+
if (!dir.endsWith((0, ($parcel$interopDefault($kTI78$path))).sep)) dir += (0, ($parcel$interopDefault($kTI78$path))).sep;
|
|
1619
1619
|
if (event.path.startsWith(dir)) for (let watcher of watchers)watcher.trigger(events);
|
|
1620
1620
|
}
|
|
1621
1621
|
}, 50);
|
|
@@ -1633,7 +1633,7 @@ class $b04b349429406f05$export$3048eb7ec07c2c4e {
|
|
|
1633
1633
|
}
|
|
1634
1634
|
watch(dir, fn, opts) {
|
|
1635
1635
|
dir = this._normalizePath(dir);
|
|
1636
|
-
let watcher = new $
|
|
1636
|
+
let watcher = new $7a85d2e5bcd45e92$var$Watcher(fn, opts);
|
|
1637
1637
|
let watchers = this.watchers.get(dir);
|
|
1638
1638
|
if (!watchers) {
|
|
1639
1639
|
watchers = new Set();
|
|
@@ -1642,7 +1642,7 @@ class $b04b349429406f05$export$3048eb7ec07c2c4e {
|
|
|
1642
1642
|
watchers.add(watcher);
|
|
1643
1643
|
return Promise.resolve({
|
|
1644
1644
|
unsubscribe: ()=>{
|
|
1645
|
-
watchers = (0, (/*@__PURE__*/$parcel$interopDefault($
|
|
1645
|
+
watchers = (0, (/*@__PURE__*/$parcel$interopDefault($3c6f2cb8f8e5311c$exports)))(watchers);
|
|
1646
1646
|
watchers.delete(watcher);
|
|
1647
1647
|
if (watchers.size === 0) this.watchers.delete(dir);
|
|
1648
1648
|
return Promise.resolve();
|
|
@@ -1654,34 +1654,35 @@ class $b04b349429406f05$export$3048eb7ec07c2c4e {
|
|
|
1654
1654
|
let len = Number(contents);
|
|
1655
1655
|
let events = this.events.slice(len);
|
|
1656
1656
|
let ignore = opts.ignore;
|
|
1657
|
-
if (ignore) events = events.filter((event)=>!ignore.some((i)=>event.path.startsWith(i + (0, ($parcel$interopDefault($
|
|
1657
|
+
if (ignore) events = events.filter((event)=>!ignore.some((i)=>event.path.startsWith(i + (0, ($parcel$interopDefault($kTI78$path))).sep)));
|
|
1658
1658
|
return events;
|
|
1659
1659
|
}
|
|
1660
1660
|
async writeSnapshot(dir, snapshot) {
|
|
1661
|
+
await this.mkdirp((0, ($parcel$interopDefault($kTI78$path))).dirname(snapshot));
|
|
1661
1662
|
await this.writeFile(snapshot, '' + this.events.length);
|
|
1662
1663
|
}
|
|
1663
1664
|
findAncestorFile(fileNames, fromDir, root) {
|
|
1664
|
-
return (0, $
|
|
1665
|
+
return (0, $d65482e6541f1ac9$export$d51a93c758976388)(this, fileNames, fromDir, root);
|
|
1665
1666
|
}
|
|
1666
1667
|
findNodeModule(moduleName, fromDir) {
|
|
1667
|
-
return (0, $
|
|
1668
|
+
return (0, $d65482e6541f1ac9$export$4c6d088a7d7f9947)(this, moduleName, fromDir);
|
|
1668
1669
|
}
|
|
1669
1670
|
findFirstFile(filePaths) {
|
|
1670
|
-
return (0, $
|
|
1671
|
+
return (0, $d65482e6541f1ac9$export$64df6e3182fd5b2d)(this, filePaths);
|
|
1671
1672
|
}
|
|
1672
1673
|
}
|
|
1673
|
-
class $
|
|
1674
|
+
class $7a85d2e5bcd45e92$var$Watcher {
|
|
1674
1675
|
constructor(fn, options){
|
|
1675
1676
|
this.fn = fn;
|
|
1676
1677
|
this.options = options;
|
|
1677
1678
|
}
|
|
1678
1679
|
trigger(events) {
|
|
1679
1680
|
let ignore = this.options.ignore;
|
|
1680
|
-
if (ignore) events = events.filter((event)=>!ignore.some((i)=>event.path.startsWith(i + (0, ($parcel$interopDefault($
|
|
1681
|
+
if (ignore) events = events.filter((event)=>!ignore.some((i)=>event.path.startsWith(i + (0, ($parcel$interopDefault($kTI78$path))).sep)));
|
|
1681
1682
|
if (events.length > 0) this.fn(null, events);
|
|
1682
1683
|
}
|
|
1683
1684
|
}
|
|
1684
|
-
class $
|
|
1685
|
+
class $7a85d2e5bcd45e92$export$d414276624ebf134 extends Error {
|
|
1685
1686
|
constructor(code, path, message){
|
|
1686
1687
|
super(`${code}: ${path} ${message}`);
|
|
1687
1688
|
this.name = 'FSError';
|
|
@@ -1690,7 +1691,7 @@ class $b04b349429406f05$export$d414276624ebf134 extends Error {
|
|
|
1690
1691
|
Error.captureStackTrace?.(this, this.constructor);
|
|
1691
1692
|
}
|
|
1692
1693
|
}
|
|
1693
|
-
class $
|
|
1694
|
+
class $7a85d2e5bcd45e92$var$ReadStream extends (0, $kTI78$stream.Readable) {
|
|
1694
1695
|
constructor(fs, filePath){
|
|
1695
1696
|
super();
|
|
1696
1697
|
this.fs = fs;
|
|
@@ -1710,7 +1711,7 @@ class $b04b349429406f05$var$ReadStream extends (0, $b70xC$stream.Readable) {
|
|
|
1710
1711
|
});
|
|
1711
1712
|
}
|
|
1712
1713
|
}
|
|
1713
|
-
class $
|
|
1714
|
+
class $7a85d2e5bcd45e92$var$WriteStream extends (0, $kTI78$stream.Writable) {
|
|
1714
1715
|
constructor(fs, filePath, options){
|
|
1715
1716
|
super({
|
|
1716
1717
|
emitClose: true,
|
|
@@ -1733,11 +1734,11 @@ class $b04b349429406f05$var$WriteStream extends (0, $b70xC$stream.Writable) {
|
|
|
1733
1734
|
this.fs.writeFile(this.filePath, this.buffer, this.options).then(callback).catch(callback);
|
|
1734
1735
|
}
|
|
1735
1736
|
}
|
|
1736
|
-
const $
|
|
1737
|
-
const $
|
|
1738
|
-
const $
|
|
1739
|
-
const $
|
|
1740
|
-
class $
|
|
1737
|
+
const $7a85d2e5bcd45e92$var$S_IFREG = 32768;
|
|
1738
|
+
const $7a85d2e5bcd45e92$var$S_IFDIR = 16384;
|
|
1739
|
+
const $7a85d2e5bcd45e92$var$S_IFLNK = 40960;
|
|
1740
|
+
const $7a85d2e5bcd45e92$var$S_IFMT = 61440;
|
|
1741
|
+
class $7a85d2e5bcd45e92$var$Entry {
|
|
1741
1742
|
constructor(mode){
|
|
1742
1743
|
this.mode = mode;
|
|
1743
1744
|
let now = Date.now();
|
|
@@ -1761,10 +1762,10 @@ class $b04b349429406f05$var$Entry {
|
|
|
1761
1762
|
return 0;
|
|
1762
1763
|
}
|
|
1763
1764
|
stat() {
|
|
1764
|
-
return new $
|
|
1765
|
+
return new $7a85d2e5bcd45e92$var$Stat(this);
|
|
1765
1766
|
}
|
|
1766
1767
|
}
|
|
1767
|
-
class $
|
|
1768
|
+
class $7a85d2e5bcd45e92$var$Stat {
|
|
1768
1769
|
dev = 0;
|
|
1769
1770
|
ino = 0;
|
|
1770
1771
|
nlink = 0;
|
|
@@ -1786,10 +1787,10 @@ class $b04b349429406f05$var$Stat {
|
|
|
1786
1787
|
this.birthtime = new Date(entry.birthtime);
|
|
1787
1788
|
}
|
|
1788
1789
|
isFile() {
|
|
1789
|
-
return Boolean(this.mode & $
|
|
1790
|
+
return Boolean(this.mode & $7a85d2e5bcd45e92$var$S_IFREG);
|
|
1790
1791
|
}
|
|
1791
1792
|
isDirectory() {
|
|
1792
|
-
return Boolean(this.mode & $
|
|
1793
|
+
return Boolean(this.mode & $7a85d2e5bcd45e92$var$S_IFDIR);
|
|
1793
1794
|
}
|
|
1794
1795
|
isBlockDevice() {
|
|
1795
1796
|
return false;
|
|
@@ -1807,17 +1808,17 @@ class $b04b349429406f05$var$Stat {
|
|
|
1807
1808
|
return false;
|
|
1808
1809
|
}
|
|
1809
1810
|
}
|
|
1810
|
-
class $
|
|
1811
|
+
class $7a85d2e5bcd45e92$var$Dirent {
|
|
1811
1812
|
#mode;
|
|
1812
1813
|
constructor(name, entry){
|
|
1813
1814
|
this.name = name;
|
|
1814
1815
|
this.#mode = entry.mode;
|
|
1815
1816
|
}
|
|
1816
1817
|
isFile() {
|
|
1817
|
-
return (this.#mode & $
|
|
1818
|
+
return (this.#mode & $7a85d2e5bcd45e92$var$S_IFMT) === $7a85d2e5bcd45e92$var$S_IFREG;
|
|
1818
1819
|
}
|
|
1819
1820
|
isDirectory() {
|
|
1820
|
-
return (this.#mode & $
|
|
1821
|
+
return (this.#mode & $7a85d2e5bcd45e92$var$S_IFMT) === $7a85d2e5bcd45e92$var$S_IFDIR;
|
|
1821
1822
|
}
|
|
1822
1823
|
isBlockDevice() {
|
|
1823
1824
|
return false;
|
|
@@ -1826,7 +1827,7 @@ class $b04b349429406f05$var$Dirent {
|
|
|
1826
1827
|
return false;
|
|
1827
1828
|
}
|
|
1828
1829
|
isSymbolicLink() {
|
|
1829
|
-
return (this.#mode & $
|
|
1830
|
+
return (this.#mode & $7a85d2e5bcd45e92$var$S_IFMT) === $7a85d2e5bcd45e92$var$S_IFLNK;
|
|
1830
1831
|
}
|
|
1831
1832
|
isFIFO() {
|
|
1832
1833
|
return false;
|
|
@@ -1835,9 +1836,9 @@ class $b04b349429406f05$var$Dirent {
|
|
|
1835
1836
|
return false;
|
|
1836
1837
|
}
|
|
1837
1838
|
}
|
|
1838
|
-
class $
|
|
1839
|
+
class $7a85d2e5bcd45e92$export$b6afa8811b7e644e extends $7a85d2e5bcd45e92$var$Entry {
|
|
1839
1840
|
constructor(buffer, mode){
|
|
1840
|
-
super($
|
|
1841
|
+
super($7a85d2e5bcd45e92$var$S_IFREG | mode);
|
|
1841
1842
|
this.buffer = buffer;
|
|
1842
1843
|
}
|
|
1843
1844
|
read() {
|
|
@@ -1845,27 +1846,27 @@ class $b04b349429406f05$export$b6afa8811b7e644e extends $b04b349429406f05$var$En
|
|
|
1845
1846
|
return Buffer.from(this.buffer);
|
|
1846
1847
|
}
|
|
1847
1848
|
write(buffer, mode) {
|
|
1848
|
-
super.modify($
|
|
1849
|
+
super.modify($7a85d2e5bcd45e92$var$S_IFREG | mode);
|
|
1849
1850
|
this.buffer = buffer;
|
|
1850
1851
|
}
|
|
1851
1852
|
getSize() {
|
|
1852
1853
|
return this.buffer.byteLength;
|
|
1853
1854
|
}
|
|
1854
1855
|
}
|
|
1855
|
-
class $
|
|
1856
|
+
class $7a85d2e5bcd45e92$var$Directory extends $7a85d2e5bcd45e92$var$Entry {
|
|
1856
1857
|
constructor(){
|
|
1857
|
-
super($
|
|
1858
|
+
super($7a85d2e5bcd45e92$var$S_IFDIR);
|
|
1858
1859
|
}
|
|
1859
1860
|
}
|
|
1860
|
-
function $
|
|
1861
|
-
if (typeof contents !== 'string' && contents.buffer instanceof (0, $
|
|
1861
|
+
function $7a85d2e5bcd45e92$export$df9eb3e75aa27a22(contents) {
|
|
1862
|
+
if (typeof contents !== 'string' && contents.buffer instanceof (0, $kTI78$atlaspackutils.SharedBuffer)) return contents;
|
|
1862
1863
|
let contentsBuffer = contents;
|
|
1863
1864
|
// $FlowFixMe
|
|
1864
1865
|
if (process.browser) // For the polyfilled buffer module, it's faster to always convert once so that the subsequent
|
|
1865
1866
|
// operations are fast (.byteLength and using .set instead of .write)
|
|
1866
1867
|
contentsBuffer = contentsBuffer instanceof Buffer ? contentsBuffer : Buffer.from(contentsBuffer);
|
|
1867
1868
|
let length = Buffer.byteLength(contentsBuffer);
|
|
1868
|
-
let shared = new (0, $
|
|
1869
|
+
let shared = new (0, $kTI78$atlaspackutils.SharedBuffer)(length);
|
|
1869
1870
|
let buffer = Buffer.from(shared);
|
|
1870
1871
|
if (length > 0) {
|
|
1871
1872
|
if (typeof contentsBuffer === 'string') buffer.write(contentsBuffer);
|
|
@@ -1873,18 +1874,18 @@ function $b04b349429406f05$export$df9eb3e75aa27a22(contents) {
|
|
|
1873
1874
|
}
|
|
1874
1875
|
return buffer;
|
|
1875
1876
|
}
|
|
1876
|
-
class $
|
|
1877
|
+
class $7a85d2e5bcd45e92$var$WorkerFS extends $7a85d2e5bcd45e92$export$3048eb7ec07c2c4e {
|
|
1877
1878
|
constructor(id, handle){
|
|
1878
1879
|
// TODO Make this not a subclass
|
|
1879
1880
|
// $FlowFixMe
|
|
1880
1881
|
super();
|
|
1881
1882
|
this.id = id;
|
|
1882
|
-
this.handleFn = (methodName, args)=>(0, ($parcel$interopDefault($
|
|
1883
|
+
this.handleFn = (methodName, args)=>(0, ($parcel$interopDefault($kTI78$atlaspackworkers))).getWorkerApi().runHandle(handle, [
|
|
1883
1884
|
methodName,
|
|
1884
1885
|
args
|
|
1885
1886
|
]);
|
|
1886
1887
|
this.handleFn('_registerWorker', [
|
|
1887
|
-
(0, ($parcel$interopDefault($
|
|
1888
|
+
(0, ($parcel$interopDefault($kTI78$atlaspackworkers))).getWorkerApi().createReverseHandle((event)=>{
|
|
1888
1889
|
switch(event.type){
|
|
1889
1890
|
case 'writeFile':
|
|
1890
1891
|
this.files.set(event.path, event.entry);
|
|
@@ -1895,7 +1896,7 @@ class $b04b349429406f05$var$WorkerFS extends $b04b349429406f05$export$3048eb7ec0
|
|
|
1895
1896
|
this.symlinks.delete(event.path);
|
|
1896
1897
|
break;
|
|
1897
1898
|
case 'mkdir':
|
|
1898
|
-
this.dirs.set(event.path, new $
|
|
1899
|
+
this.dirs.set(event.path, new $7a85d2e5bcd45e92$var$Directory());
|
|
1899
1900
|
break;
|
|
1900
1901
|
case 'symlink':
|
|
1901
1902
|
this.symlinks.set(event.path, event.target);
|
|
@@ -1905,7 +1906,7 @@ class $b04b349429406f05$var$WorkerFS extends $b04b349429406f05$export$3048eb7ec0
|
|
|
1905
1906
|
]);
|
|
1906
1907
|
}
|
|
1907
1908
|
static deserialize(opts) {
|
|
1908
|
-
return (0, (/*@__PURE__*/$parcel$interopDefault($
|
|
1909
|
+
return (0, (/*@__PURE__*/$parcel$interopDefault($3c6f2cb8f8e5311c$exports)))($7a85d2e5bcd45e92$var$instances.get(opts.id));
|
|
1909
1910
|
}
|
|
1910
1911
|
serialize() {
|
|
1911
1912
|
// $FlowFixMe
|
|
@@ -1915,7 +1916,7 @@ class $b04b349429406f05$var$WorkerFS extends $b04b349429406f05$export$3048eb7ec0
|
|
|
1915
1916
|
}
|
|
1916
1917
|
writeFile(filePath, contents, options) {
|
|
1917
1918
|
super.writeFile(filePath, contents, options);
|
|
1918
|
-
let buffer = $
|
|
1919
|
+
let buffer = $7a85d2e5bcd45e92$export$df9eb3e75aa27a22(contents);
|
|
1919
1920
|
return this.handleFn('writeFile', [
|
|
1920
1921
|
filePath,
|
|
1921
1922
|
buffer,
|
|
@@ -1955,16 +1956,16 @@ class $b04b349429406f05$var$WorkerFS extends $b04b349429406f05$export$3048eb7ec0
|
|
|
1955
1956
|
]);
|
|
1956
1957
|
}
|
|
1957
1958
|
}
|
|
1958
|
-
(0, $
|
|
1959
|
-
(0, $
|
|
1960
|
-
(0, $
|
|
1961
|
-
(0, $
|
|
1962
|
-
(0, $
|
|
1959
|
+
(0, $kTI78$atlaspackbuildcache.registerSerializableClass)(`${(0, (/*@__PURE__*/$parcel$interopDefault($eac1f2f4592d0c44$exports))).version}:MemoryFS`, $7a85d2e5bcd45e92$export$3048eb7ec07c2c4e);
|
|
1960
|
+
(0, $kTI78$atlaspackbuildcache.registerSerializableClass)(`${(0, (/*@__PURE__*/$parcel$interopDefault($eac1f2f4592d0c44$exports))).version}:WorkerFS`, $7a85d2e5bcd45e92$var$WorkerFS);
|
|
1961
|
+
(0, $kTI78$atlaspackbuildcache.registerSerializableClass)(`${(0, (/*@__PURE__*/$parcel$interopDefault($eac1f2f4592d0c44$exports))).version}:Stat`, $7a85d2e5bcd45e92$var$Stat);
|
|
1962
|
+
(0, $kTI78$atlaspackbuildcache.registerSerializableClass)(`${(0, (/*@__PURE__*/$parcel$interopDefault($eac1f2f4592d0c44$exports))).version}:File`, $7a85d2e5bcd45e92$export$b6afa8811b7e644e);
|
|
1963
|
+
(0, $kTI78$atlaspackbuildcache.registerSerializableClass)(`${(0, (/*@__PURE__*/$parcel$interopDefault($eac1f2f4592d0c44$exports))).version}:Directory`, $7a85d2e5bcd45e92$var$Directory);
|
|
1963
1964
|
|
|
1964
1965
|
|
|
1965
|
-
var $
|
|
1966
|
+
var $e0baf6d453e0601b$exports = {};
|
|
1966
1967
|
|
|
1967
|
-
$parcel$export($
|
|
1968
|
+
$parcel$export($e0baf6d453e0601b$exports, "OverlayFS", () => $e0baf6d453e0601b$export$5963299e2424ca1c);
|
|
1968
1969
|
|
|
1969
1970
|
|
|
1970
1971
|
|
|
@@ -1972,16 +1973,16 @@ $parcel$export($ec29e7a1a330544d$exports, "OverlayFS", () => $ec29e7a1a330544d$e
|
|
|
1972
1973
|
|
|
1973
1974
|
|
|
1974
1975
|
|
|
1975
|
-
class $
|
|
1976
|
+
class $e0baf6d453e0601b$export$5963299e2424ca1c {
|
|
1976
1977
|
deleted = new Set();
|
|
1977
1978
|
constructor(workerFarmOrFS, readable){
|
|
1978
|
-
if (workerFarmOrFS instanceof (0, ($parcel$interopDefault($
|
|
1979
|
+
if (workerFarmOrFS instanceof (0, ($parcel$interopDefault($kTI78$atlaspackworkers)))) this.writable = new (0, $7a85d2e5bcd45e92$export$3048eb7ec07c2c4e)(workerFarmOrFS);
|
|
1979
1980
|
else this.writable = workerFarmOrFS;
|
|
1980
1981
|
this.readable = readable;
|
|
1981
1982
|
this._cwd = readable.cwd();
|
|
1982
1983
|
}
|
|
1983
1984
|
static deserialize(opts) {
|
|
1984
|
-
let fs = new $
|
|
1985
|
+
let fs = new $e0baf6d453e0601b$export$5963299e2424ca1c(opts.writable, opts.readable);
|
|
1985
1986
|
if (opts.deleted != null) fs.deleted = opts.deleted;
|
|
1986
1987
|
return fs;
|
|
1987
1988
|
}
|
|
@@ -1995,28 +1996,28 @@ class $ec29e7a1a330544d$export$5963299e2424ca1c {
|
|
|
1995
1996
|
}
|
|
1996
1997
|
_deletedThrows(filePath) {
|
|
1997
1998
|
filePath = this._normalizePath(filePath);
|
|
1998
|
-
if (this.deleted.has(filePath)) throw new $
|
|
1999
|
+
if (this.deleted.has(filePath)) throw new $e0baf6d453e0601b$var$FSError('ENOENT', filePath, 'does not exist');
|
|
1999
2000
|
return filePath;
|
|
2000
2001
|
}
|
|
2001
2002
|
_checkExists(filePath) {
|
|
2002
2003
|
filePath = this._deletedThrows(filePath);
|
|
2003
|
-
if (!this.existsSync(filePath)) throw new $
|
|
2004
|
+
if (!this.existsSync(filePath)) throw new $e0baf6d453e0601b$var$FSError('ENOENT', filePath, 'does not exist');
|
|
2004
2005
|
return filePath;
|
|
2005
2006
|
}
|
|
2006
2007
|
_isSymlink(filePath) {
|
|
2007
2008
|
filePath = this._normalizePath(filePath);
|
|
2008
2009
|
// Check the parts of the path to see if any are symlinks.
|
|
2009
|
-
let { root: root, dir: dir, base: base } = (0, ($parcel$interopDefault($
|
|
2010
|
-
let segments = dir.slice(root.length).split((0, ($parcel$interopDefault($
|
|
2010
|
+
let { root: root, dir: dir, base: base } = (0, ($parcel$interopDefault($kTI78$path))).parse(filePath);
|
|
2011
|
+
let segments = dir.slice(root.length).split((0, ($parcel$interopDefault($kTI78$path))).sep).concat(base);
|
|
2011
2012
|
while(segments.length){
|
|
2012
|
-
filePath = (0, ($parcel$interopDefault($
|
|
2013
|
+
filePath = (0, ($parcel$interopDefault($kTI78$path))).join(root, ...segments);
|
|
2013
2014
|
let name = segments.pop();
|
|
2014
2015
|
if (this.deleted.has(filePath)) return false;
|
|
2015
|
-
else if (this.writable instanceof (0, $
|
|
2016
|
+
else if (this.writable instanceof (0, $7a85d2e5bcd45e92$export$3048eb7ec07c2c4e) && this.writable.symlinks.has(filePath)) return true;
|
|
2016
2017
|
else {
|
|
2017
2018
|
// HACK: Atlaspack fs does not provide `lstatSync`,
|
|
2018
2019
|
// so we use `readdirSync` to check if the path is a symlink.
|
|
2019
|
-
let parent = (0, ($parcel$interopDefault($
|
|
2020
|
+
let parent = (0, ($parcel$interopDefault($kTI78$path))).resolve(filePath, '..');
|
|
2020
2021
|
if (parent === filePath) return false;
|
|
2021
2022
|
try {
|
|
2022
2023
|
for (let dirent of this.readdirSync(parent, {
|
|
@@ -2037,12 +2038,12 @@ class $ec29e7a1a330544d$export$5963299e2424ca1c {
|
|
|
2037
2038
|
}
|
|
2038
2039
|
async _copyPathForWrite(filePath) {
|
|
2039
2040
|
filePath = await this._normalizePath(filePath);
|
|
2040
|
-
let dirPath = (0, ($parcel$interopDefault($
|
|
2041
|
+
let dirPath = (0, ($parcel$interopDefault($kTI78$path))).dirname(filePath);
|
|
2041
2042
|
if (this.existsSync(dirPath) && !this.writable.existsSync(dirPath)) await this.writable.mkdirp(dirPath);
|
|
2042
2043
|
return filePath;
|
|
2043
2044
|
}
|
|
2044
2045
|
_normalizePath(filePath) {
|
|
2045
|
-
return (0, ($parcel$interopDefault($
|
|
2046
|
+
return (0, ($parcel$interopDefault($kTI78$path))).resolve(this.cwd(), filePath);
|
|
2046
2047
|
}
|
|
2047
2048
|
// eslint-disable-next-line require-await
|
|
2048
2049
|
async readFile(filePath, encoding) {
|
|
@@ -2075,22 +2076,22 @@ class $ec29e7a1a330544d$export$5963299e2424ca1c {
|
|
|
2075
2076
|
let toDelete = [
|
|
2076
2077
|
filePath
|
|
2077
2078
|
];
|
|
2078
|
-
if (this.writable instanceof (0, $
|
|
2079
|
+
if (this.writable instanceof (0, $7a85d2e5bcd45e92$export$3048eb7ec07c2c4e) && this._isSymlink(filePath)) this.writable.symlinks.delete(filePath);
|
|
2079
2080
|
else if (this.statSync(filePath).isDirectory()) {
|
|
2080
2081
|
let stack = [
|
|
2081
2082
|
filePath
|
|
2082
2083
|
];
|
|
2083
2084
|
// Recursively add every descendant path to deleted.
|
|
2084
2085
|
while(stack.length){
|
|
2085
|
-
let root = (0, (/*@__PURE__*/$parcel$interopDefault($
|
|
2086
|
+
let root = (0, (/*@__PURE__*/$parcel$interopDefault($3c6f2cb8f8e5311c$exports)))(stack.pop());
|
|
2086
2087
|
for (let ent of this.readdirSync(root, {
|
|
2087
2088
|
withFileTypes: true
|
|
2088
2089
|
}))if (typeof ent === 'string') {
|
|
2089
|
-
let childPath = (0, ($parcel$interopDefault($
|
|
2090
|
+
let childPath = (0, ($parcel$interopDefault($kTI78$path))).join(root, ent);
|
|
2090
2091
|
toDelete.push(childPath);
|
|
2091
2092
|
if (this.statSync(childPath).isDirectory()) stack.push(childPath);
|
|
2092
2093
|
} else {
|
|
2093
|
-
let childPath = (0, ($parcel$interopDefault($
|
|
2094
|
+
let childPath = (0, ($parcel$interopDefault($kTI78$path))).join(root, ent.name);
|
|
2094
2095
|
toDelete.push(childPath);
|
|
2095
2096
|
if (ent.isDirectory()) stack.push(childPath);
|
|
2096
2097
|
}
|
|
@@ -2107,10 +2108,10 @@ class $ec29e7a1a330544d$export$5963299e2424ca1c {
|
|
|
2107
2108
|
dir = this._normalizePath(dir);
|
|
2108
2109
|
await this.writable.mkdirp(dir);
|
|
2109
2110
|
if (this.deleted != null) {
|
|
2110
|
-
let root = (0, ($parcel$interopDefault($
|
|
2111
|
+
let root = (0, ($parcel$interopDefault($kTI78$path))).parse(dir).root;
|
|
2111
2112
|
while(dir !== root){
|
|
2112
2113
|
this.deleted.delete(dir);
|
|
2113
|
-
dir = (0, ($parcel$interopDefault($
|
|
2114
|
+
dir = (0, ($parcel$interopDefault($kTI78$path))).dirname(dir);
|
|
2114
2115
|
}
|
|
2115
2116
|
}
|
|
2116
2117
|
}
|
|
@@ -2196,7 +2197,7 @@ class $ec29e7a1a330544d$export$5963299e2424ca1c {
|
|
|
2196
2197
|
let entries = new Map();
|
|
2197
2198
|
try {
|
|
2198
2199
|
for (let entry of this.writable.readdirSync(dir, opts)){
|
|
2199
|
-
let filePath = (0, ($parcel$interopDefault($
|
|
2200
|
+
let filePath = (0, ($parcel$interopDefault($kTI78$path))).join(dir, entry.name ?? entry);
|
|
2200
2201
|
if (this.deleted.has(filePath)) continue;
|
|
2201
2202
|
entries.set(filePath, entry);
|
|
2202
2203
|
}
|
|
@@ -2205,7 +2206,7 @@ class $ec29e7a1a330544d$export$5963299e2424ca1c {
|
|
|
2205
2206
|
}
|
|
2206
2207
|
try {
|
|
2207
2208
|
for (let entry of this.readable.readdirSync(dir, opts)){
|
|
2208
|
-
let filePath = (0, ($parcel$interopDefault($
|
|
2209
|
+
let filePath = (0, ($parcel$interopDefault($kTI78$path))).join(dir, entry.name ?? entry);
|
|
2209
2210
|
if (this.deleted.has(filePath)) continue;
|
|
2210
2211
|
if (entries.has(filePath)) continue;
|
|
2211
2212
|
entries.set(filePath, entry);
|
|
@@ -2237,16 +2238,16 @@ class $ec29e7a1a330544d$export$5963299e2424ca1c {
|
|
|
2237
2238
|
await this.writable.writeSnapshot(dir, snapshot, opts);
|
|
2238
2239
|
}
|
|
2239
2240
|
findAncestorFile(fileNames, fromDir, root) {
|
|
2240
|
-
return (0, $
|
|
2241
|
+
return (0, $d65482e6541f1ac9$export$d51a93c758976388)(this, fileNames, fromDir, root);
|
|
2241
2242
|
}
|
|
2242
2243
|
findNodeModule(moduleName, fromDir) {
|
|
2243
|
-
return (0, $
|
|
2244
|
+
return (0, $d65482e6541f1ac9$export$4c6d088a7d7f9947)(this, moduleName, fromDir);
|
|
2244
2245
|
}
|
|
2245
2246
|
findFirstFile(filePaths) {
|
|
2246
|
-
return (0, $
|
|
2247
|
+
return (0, $d65482e6541f1ac9$export$64df6e3182fd5b2d)(this, filePaths);
|
|
2247
2248
|
}
|
|
2248
2249
|
}
|
|
2249
|
-
class $
|
|
2250
|
+
class $e0baf6d453e0601b$var$FSError extends Error {
|
|
2250
2251
|
constructor(code, path, message){
|
|
2251
2252
|
super(`${code}: ${path} ${message}`);
|
|
2252
2253
|
this.name = 'FSError';
|
|
@@ -2255,24 +2256,24 @@ class $ec29e7a1a330544d$var$FSError extends Error {
|
|
|
2255
2256
|
Error.captureStackTrace?.(this, this.constructor);
|
|
2256
2257
|
}
|
|
2257
2258
|
}
|
|
2258
|
-
(0, $
|
|
2259
|
+
(0, $kTI78$atlaspackbuildcache.registerSerializableClass)(`${(0, (/*@__PURE__*/$parcel$interopDefault($eac1f2f4592d0c44$exports))).version}:OverlayFS`, $e0baf6d453e0601b$export$5963299e2424ca1c);
|
|
2259
2260
|
|
|
2260
2261
|
|
|
2261
|
-
const $
|
|
2262
|
-
async function $
|
|
2262
|
+
const $f850a02712c7cafd$var$pipeline = (0, $kTI78$util.promisify)((0, ($parcel$interopDefault($kTI78$stream))).pipeline);
|
|
2263
|
+
async function $f850a02712c7cafd$export$d3a8044e3fef7335(sourceFS, source, destinationFS, destination) {
|
|
2263
2264
|
await destinationFS.mkdirp(destination);
|
|
2264
2265
|
let files = await sourceFS.readdir(source);
|
|
2265
2266
|
for (let file of files){
|
|
2266
|
-
let sourcePath = (0, ($parcel$interopDefault($
|
|
2267
|
-
let destPath = (0, ($parcel$interopDefault($
|
|
2267
|
+
let sourcePath = (0, ($parcel$interopDefault($kTI78$path))).join(source, file);
|
|
2268
|
+
let destPath = (0, ($parcel$interopDefault($kTI78$path))).join(destination, file);
|
|
2268
2269
|
let stats = await sourceFS.stat(sourcePath);
|
|
2269
|
-
if (stats.isFile()) await $
|
|
2270
|
-
else if (stats.isDirectory()) await $
|
|
2270
|
+
if (stats.isFile()) await $f850a02712c7cafd$var$pipeline(sourceFS.createReadStream(sourcePath), destinationFS.createWriteStream(destPath));
|
|
2271
|
+
else if (stats.isDirectory()) await $f850a02712c7cafd$export$d3a8044e3fef7335(sourceFS, sourcePath, destinationFS, destPath);
|
|
2271
2272
|
}
|
|
2272
2273
|
}
|
|
2273
|
-
$parcel$exportWildcard(module.exports, $
|
|
2274
|
-
$parcel$exportWildcard(module.exports, $
|
|
2275
|
-
$parcel$exportWildcard(module.exports, $
|
|
2274
|
+
$parcel$exportWildcard(module.exports, $f8ce570f65ef93a7$exports);
|
|
2275
|
+
$parcel$exportWildcard(module.exports, $7a85d2e5bcd45e92$exports);
|
|
2276
|
+
$parcel$exportWildcard(module.exports, $e0baf6d453e0601b$exports);
|
|
2276
2277
|
|
|
2277
2278
|
|
|
2278
2279
|
//# sourceMappingURL=index.js.map
|