@atlaspack/fs 2.12.1-dev.3398 → 2.12.1-dev.3443
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 -169
- package/lib/browser.js.map +1 -1
- package/lib/index.js +342 -342
- package/lib/index.js.map +1 -1
- package/package.json +10 -10
- package/src/NodeFS.js +1 -1
- package/src/OverlayFS.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 $b70xC$path = require("path");
|
|
2
|
+
var $b70xC$stream = require("stream");
|
|
3
|
+
var $b70xC$util = require("util");
|
|
4
|
+
var $b70xC$fs = require("fs");
|
|
5
|
+
var $b70xC$os = require("os");
|
|
6
|
+
var $b70xC$atlaspackcore = require("@atlaspack/core");
|
|
7
|
+
var $b70xC$atlaspackutils = require("@atlaspack/utils");
|
|
8
|
+
var $b70xC$atlaspackfeatureflags = require("@atlaspack/feature-flags");
|
|
9
|
+
var $b70xC$parcelwatcher = require("@parcel/watcher");
|
|
10
|
+
var $b70xC$atlaspackrust = require("@atlaspack/rust");
|
|
11
|
+
var $b70xC$assert = require("assert");
|
|
12
|
+
var $b70xC$constants = require("constants");
|
|
13
|
+
var $b70xC$atlaspackworkers = require("@atlaspack/workers");
|
|
14
|
+
var $b70xC$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", () => $8eabb55e3bc645c7$export$d3a8044e3fef7335);
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
var $
|
|
48
|
+
var $c384d5a91630ebac$exports = {};
|
|
49
49
|
|
|
50
|
-
$parcel$export($
|
|
51
|
-
var $
|
|
50
|
+
$parcel$export($c384d5a91630ebac$exports, "NodeFS", () => $c384d5a91630ebac$export$c4e0ef2ab73c21e7);
|
|
51
|
+
var $c9fef47dc93720ea$exports = {};
|
|
52
52
|
|
|
53
|
-
var $
|
|
53
|
+
var $7dfb012429e93f65$exports = {};
|
|
54
54
|
|
|
55
|
-
var $
|
|
56
|
-
var $
|
|
57
|
-
var $
|
|
55
|
+
var $7dfb012429e93f65$var$origCwd = process.cwd;
|
|
56
|
+
var $7dfb012429e93f65$var$cwd = null;
|
|
57
|
+
var $7dfb012429e93f65$var$platform = process.env.GRACEFUL_FS_PLATFORM || process.platform;
|
|
58
58
|
process.cwd = function() {
|
|
59
|
-
if (!$
|
|
60
|
-
return $
|
|
59
|
+
if (!$7dfb012429e93f65$var$cwd) $7dfb012429e93f65$var$cwd = $7dfb012429e93f65$var$origCwd.call(process);
|
|
60
|
+
return $7dfb012429e93f65$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 $7dfb012429e93f65$var$chdir = process.chdir;
|
|
68
68
|
process.chdir = function(d) {
|
|
69
|
-
$
|
|
70
|
-
$
|
|
69
|
+
$7dfb012429e93f65$var$cwd = null;
|
|
70
|
+
$7dfb012429e93f65$var$chdir.call(process, d);
|
|
71
71
|
};
|
|
72
|
-
if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, $
|
|
72
|
+
if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, $7dfb012429e93f65$var$chdir);
|
|
73
73
|
}
|
|
74
|
-
$
|
|
75
|
-
function $
|
|
74
|
+
$7dfb012429e93f65$exports = $7dfb012429e93f65$var$patch;
|
|
75
|
+
function $7dfb012429e93f65$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 ($b70xC$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 $62dc3839f187e943$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 ($7dfb012429e93f65$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 $62dc3839f187e943$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, $b70xC$constants.O_WRONLY | $b70xC$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 $62dc3839f187e943$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, $b70xC$constants.O_WRONLY | $b70xC$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 $62dc3839f187e943$var$patch(fs) {
|
|
|
212
212
|
};
|
|
213
213
|
}
|
|
214
214
|
function patchLutimes(fs) {
|
|
215
|
-
if ($
|
|
215
|
+
if ($b70xC$constants.hasOwnProperty("O_SYMLINK") && fs.futimes) {
|
|
216
216
|
fs.lutimes = function(path, at, mt, cb) {
|
|
217
|
-
fs.open(path, $
|
|
217
|
+
fs.open(path, $b70xC$constants.O_SYMLINK, function(er, fd) {
|
|
218
218
|
if (er) {
|
|
219
219
|
if (cb) cb(er);
|
|
220
220
|
return;
|
|
@@ -227,7 +227,7 @@ function $62dc3839f187e943$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, $b70xC$constants.O_SYMLINK);
|
|
231
231
|
var ret;
|
|
232
232
|
var threw = true;
|
|
233
233
|
try {
|
|
@@ -342,18 +342,18 @@ function $62dc3839f187e943$var$patch(fs) {
|
|
|
342
342
|
}
|
|
343
343
|
|
|
344
344
|
|
|
345
|
-
var $
|
|
345
|
+
var $beafe7e5be87f321$exports = {};
|
|
346
346
|
|
|
347
|
-
var $
|
|
348
|
-
$
|
|
349
|
-
function $
|
|
347
|
+
var $beafe7e5be87f321$require$Stream = $b70xC$stream.Stream;
|
|
348
|
+
$beafe7e5be87f321$exports = $beafe7e5be87f321$var$legacy;
|
|
349
|
+
function $beafe7e5be87f321$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
|
+
$beafe7e5be87f321$require$Stream.call(this);
|
|
357
357
|
var self = this;
|
|
358
358
|
this.path = path;
|
|
359
359
|
this.fd = null;
|
|
@@ -396,7 +396,7 @@ function $dd8f2c33a06f99ca$var$legacy(fs) {
|
|
|
396
396
|
}
|
|
397
397
|
function WriteStream(path, options) {
|
|
398
398
|
if (!(this instanceof WriteStream)) return new WriteStream(path, options);
|
|
399
|
-
$
|
|
399
|
+
$beafe7e5be87f321$require$Stream.call(this);
|
|
400
400
|
this.path = path;
|
|
401
401
|
this.fd = null;
|
|
402
402
|
this.writable = true;
|
|
@@ -433,16 +433,16 @@ function $dd8f2c33a06f99ca$var$legacy(fs) {
|
|
|
433
433
|
}
|
|
434
434
|
|
|
435
435
|
|
|
436
|
-
var $
|
|
436
|
+
var $c348b67ed1cdef35$exports = {};
|
|
437
437
|
'use strict';
|
|
438
|
-
$
|
|
439
|
-
var $
|
|
438
|
+
$c348b67ed1cdef35$exports = $c348b67ed1cdef35$var$clone;
|
|
439
|
+
var $c348b67ed1cdef35$var$getPrototypeOf = Object.getPrototypeOf || function(obj) {
|
|
440
440
|
return obj.__proto__;
|
|
441
441
|
};
|
|
442
|
-
function $
|
|
442
|
+
function $c348b67ed1cdef35$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__: $c348b67ed1cdef35$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 $3c4b7a3d3568cdcd$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 $c9fef47dc93720ea$var$gracefulQueue;
|
|
457
|
+
var $c9fef47dc93720ea$var$previousSymbol;
|
|
458
458
|
/* istanbul ignore else - node 0.x polyfill */ if (typeof Symbol === 'function' && typeof Symbol.for === 'function') {
|
|
459
|
-
$
|
|
459
|
+
$c9fef47dc93720ea$var$gracefulQueue = Symbol.for('graceful-fs.queue');
|
|
460
460
|
// This is used in testing by future versions
|
|
461
|
-
$
|
|
461
|
+
$c9fef47dc93720ea$var$previousSymbol = Symbol.for('graceful-fs.previous');
|
|
462
462
|
} else {
|
|
463
|
-
$
|
|
464
|
-
$
|
|
463
|
+
$c9fef47dc93720ea$var$gracefulQueue = '___graceful-fs.queue';
|
|
464
|
+
$c9fef47dc93720ea$var$previousSymbol = '___graceful-fs.previous';
|
|
465
465
|
}
|
|
466
|
-
function $
|
|
467
|
-
function $
|
|
468
|
-
Object.defineProperty(context, $
|
|
466
|
+
function $c9fef47dc93720ea$var$noop() {}
|
|
467
|
+
function $c9fef47dc93720ea$var$publishQueue(context, queue) {
|
|
468
|
+
Object.defineProperty(context, $c9fef47dc93720ea$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 $c9fef47dc93720ea$var$debug = $c9fef47dc93720ea$var$noop;
|
|
475
|
+
if ($b70xC$util.debuglog) $c9fef47dc93720ea$var$debug = $b70xC$util.debuglog('gfs4');
|
|
476
|
+
else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) $c9fef47dc93720ea$var$debug = function() {
|
|
477
|
+
var m = $b70xC$util.format.apply($b70xC$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 (!$b70xC$fs[$c9fef47dc93720ea$var$gracefulQueue]) {
|
|
484
484
|
// This queue can be shared by multiple loaded instances
|
|
485
|
-
var $
|
|
486
|
-
$
|
|
485
|
+
var $c9fef47dc93720ea$var$queue = $parcel$global[$c9fef47dc93720ea$var$gracefulQueue] || [];
|
|
486
|
+
$c9fef47dc93720ea$var$publishQueue($b70xC$fs, $c9fef47dc93720ea$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
|
+
$b70xC$fs.close = function(fs$close) {
|
|
492
492
|
function close(fd, cb) {
|
|
493
|
-
return fs$close.call($
|
|
493
|
+
return fs$close.call($b70xC$fs, fd, function(err) {
|
|
494
494
|
// This function uses the graceful-fs shared queue
|
|
495
|
-
if (!err) $
|
|
495
|
+
if (!err) $c9fef47dc93720ea$var$resetQueue();
|
|
496
496
|
if (typeof cb === 'function') cb.apply(this, arguments);
|
|
497
497
|
});
|
|
498
498
|
}
|
|
499
|
-
Object.defineProperty(close, $
|
|
499
|
+
Object.defineProperty(close, $c9fef47dc93720ea$var$previousSymbol, {
|
|
500
500
|
value: fs$close
|
|
501
501
|
});
|
|
502
502
|
return close;
|
|
503
|
-
}($
|
|
504
|
-
$
|
|
503
|
+
}($b70xC$fs.close);
|
|
504
|
+
$b70xC$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($b70xC$fs, arguments);
|
|
508
|
+
$c9fef47dc93720ea$var$resetQueue();
|
|
509
509
|
}
|
|
510
|
-
Object.defineProperty(closeSync, $
|
|
510
|
+
Object.defineProperty(closeSync, $c9fef47dc93720ea$var$previousSymbol, {
|
|
511
511
|
value: fs$closeSync
|
|
512
512
|
});
|
|
513
513
|
return closeSync;
|
|
514
|
-
}($
|
|
514
|
+
}($b70xC$fs.closeSync);
|
|
515
515
|
if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) process.on('exit', function() {
|
|
516
|
-
$
|
|
517
|
-
$
|
|
516
|
+
$c9fef47dc93720ea$var$debug($b70xC$fs[$c9fef47dc93720ea$var$gracefulQueue]);
|
|
517
|
+
$b70xC$assert.equal($b70xC$fs[$c9fef47dc93720ea$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[$c9fef47dc93720ea$var$gracefulQueue]) $c9fef47dc93720ea$var$publishQueue($parcel$global, $b70xC$fs[$c9fef47dc93720ea$var$gracefulQueue]);
|
|
521
|
+
$c9fef47dc93720ea$exports = $c9fef47dc93720ea$var$patch($c348b67ed1cdef35$exports($b70xC$fs));
|
|
522
|
+
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !$b70xC$fs.__patched) {
|
|
523
|
+
$c9fef47dc93720ea$exports = $c9fef47dc93720ea$var$patch($b70xC$fs);
|
|
524
|
+
$b70xC$fs.__patched = true;
|
|
525
525
|
}
|
|
526
|
-
function $
|
|
526
|
+
function $c9fef47dc93720ea$var$patch(fs) {
|
|
527
527
|
// Everything that references the open() function needs to be in here
|
|
528
|
-
$
|
|
529
|
-
fs.gracefulify = $
|
|
528
|
+
$7dfb012429e93f65$exports(fs);
|
|
529
|
+
fs.gracefulify = $c9fef47dc93720ea$var$patch;
|
|
530
530
|
fs.createReadStream = createReadStream;
|
|
531
531
|
fs.createWriteStream = createWriteStream;
|
|
532
532
|
var fs$readFile = fs.readFile;
|
|
@@ -536,7 +536,7 @@ function $1b674202ab68c176$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')) $c9fef47dc93720ea$var$enqueue([
|
|
540
540
|
go$readFile,
|
|
541
541
|
[
|
|
542
542
|
path,
|
|
@@ -558,7 +558,7 @@ function $1b674202ab68c176$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')) $c9fef47dc93720ea$var$enqueue([
|
|
562
562
|
go$writeFile,
|
|
563
563
|
[
|
|
564
564
|
path,
|
|
@@ -581,7 +581,7 @@ function $1b674202ab68c176$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')) $c9fef47dc93720ea$var$enqueue([
|
|
585
585
|
go$appendFile,
|
|
586
586
|
[
|
|
587
587
|
path,
|
|
@@ -607,7 +607,7 @@ function $1b674202ab68c176$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')) $c9fef47dc93720ea$var$enqueue([
|
|
611
611
|
go$copyFile,
|
|
612
612
|
[
|
|
613
613
|
src,
|
|
@@ -636,7 +636,7 @@ function $1b674202ab68c176$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')) $c9fef47dc93720ea$var$enqueue([
|
|
640
640
|
go$readdir,
|
|
641
641
|
[
|
|
642
642
|
path,
|
|
@@ -655,7 +655,7 @@ function $1b674202ab68c176$var$patch(fs) {
|
|
|
655
655
|
}
|
|
656
656
|
}
|
|
657
657
|
if (process.version.substr(0, 4) === 'v0.8') {
|
|
658
|
-
var legStreams = $
|
|
658
|
+
var legStreams = $beafe7e5be87f321$exports(fs);
|
|
659
659
|
ReadStream = legStreams.ReadStream;
|
|
660
660
|
WriteStream = legStreams.WriteStream;
|
|
661
661
|
}
|
|
@@ -758,7 +758,7 @@ function $1b674202ab68c176$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')) $c9fef47dc93720ea$var$enqueue([
|
|
762
762
|
go$open,
|
|
763
763
|
[
|
|
764
764
|
path,
|
|
@@ -776,35 +776,35 @@ function $1b674202ab68c176$var$patch(fs) {
|
|
|
776
776
|
}
|
|
777
777
|
return fs;
|
|
778
778
|
}
|
|
779
|
-
function $
|
|
780
|
-
$
|
|
781
|
-
$
|
|
782
|
-
$
|
|
779
|
+
function $c9fef47dc93720ea$var$enqueue(elem) {
|
|
780
|
+
$c9fef47dc93720ea$var$debug('ENQUEUE', elem[0].name, elem[1]);
|
|
781
|
+
$b70xC$fs[$c9fef47dc93720ea$var$gracefulQueue].push(elem);
|
|
782
|
+
$c9fef47dc93720ea$var$retry();
|
|
783
783
|
}
|
|
784
784
|
// keep track of the timeout between retry() calls
|
|
785
|
-
var $
|
|
785
|
+
var $c9fef47dc93720ea$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 $c9fef47dc93720ea$var$resetQueue() {
|
|
790
790
|
var now = Date.now();
|
|
791
|
-
for(var i = 0; i < $
|
|
791
|
+
for(var i = 0; i < $b70xC$fs[$c9fef47dc93720ea$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 ($b70xC$fs[$c9fef47dc93720ea$var$gracefulQueue][i].length > 2) {
|
|
794
|
+
$b70xC$fs[$c9fef47dc93720ea$var$gracefulQueue][i][3] = now // startTime
|
|
795
795
|
;
|
|
796
|
-
$
|
|
796
|
+
$b70xC$fs[$c9fef47dc93720ea$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
|
+
$c9fef47dc93720ea$var$retry();
|
|
801
801
|
}
|
|
802
|
-
function $
|
|
802
|
+
function $c9fef47dc93720ea$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($c9fef47dc93720ea$var$retryTimer);
|
|
805
|
+
$c9fef47dc93720ea$var$retryTimer = undefined;
|
|
806
|
+
if ($b70xC$fs[$c9fef47dc93720ea$var$gracefulQueue].length === 0) return;
|
|
807
|
+
var elem = $b70xC$fs[$c9fef47dc93720ea$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 $1b674202ab68c176$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
|
+
$c9fef47dc93720ea$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
|
+
$c9fef47dc93720ea$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 $1b674202ab68c176$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
|
+
$c9fef47dc93720ea$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
|
+
$b70xC$fs[$c9fef47dc93720ea$var$gracefulQueue].push(elem);
|
|
842
842
|
}
|
|
843
843
|
// schedule our next run if one isn't already scheduled
|
|
844
|
-
if ($
|
|
844
|
+
if ($c9fef47dc93720ea$var$retryTimer === undefined) $c9fef47dc93720ea$var$retryTimer = setTimeout($c9fef47dc93720ea$var$retry, 0);
|
|
845
845
|
}
|
|
846
846
|
|
|
847
847
|
|
|
848
848
|
|
|
849
|
-
var $
|
|
849
|
+
var $2eff50cbbfc18abd$exports = {};
|
|
850
850
|
|
|
851
851
|
|
|
852
|
-
$
|
|
853
|
-
$
|
|
854
|
-
function $
|
|
852
|
+
$2eff50cbbfc18abd$exports = $2eff50cbbfc18abd$var$ncp;
|
|
853
|
+
$2eff50cbbfc18abd$var$ncp.ncp = $2eff50cbbfc18abd$var$ncp;
|
|
854
|
+
function $2eff50cbbfc18abd$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 = $b70xC$path.resolve(basePath, source), targetPath = $b70xC$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 || $2eff50cbbfc18abd$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 $c023d554c0890ceb$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 ? $b70xC$fs.stat : $b70xC$fs.lstat;
|
|
876
876
|
if (running >= limit) return setImmediate(function() {
|
|
877
877
|
getStats(source);
|
|
878
878
|
});
|
|
@@ -900,7 +900,7 @@ function $c023d554c0890ceb$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 ? $b70xC$fs.stat : $b70xC$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 $c023d554c0890ceb$var$ncp(source, dest, options, callback) {
|
|
|
910
910
|
});
|
|
911
911
|
}
|
|
912
912
|
function copyFile(file, target) {
|
|
913
|
-
var readStream = $
|
|
913
|
+
var readStream = $b70xC$fs.createReadStream(file.name), writeStream = $b70xC$fs.createWriteStream(target, {
|
|
914
914
|
mode: file.mode
|
|
915
915
|
});
|
|
916
916
|
readStream.on('error', onError);
|
|
@@ -922,13 +922,13 @@ function $c023d554c0890ceb$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
|
+
$b70xC$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
|
+
$b70xC$fs.unlink(file, function(err) {
|
|
932
932
|
if (err) return onError(err);
|
|
933
933
|
return done();
|
|
934
934
|
});
|
|
@@ -941,34 +941,34 @@ function $c023d554c0890ceb$var$ncp(source, dest, options, callback) {
|
|
|
941
941
|
});
|
|
942
942
|
}
|
|
943
943
|
function mkDir(dir, target) {
|
|
944
|
-
$
|
|
944
|
+
$b70xC$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
|
+
$b70xC$fs.readdir(dir, function(err, items) {
|
|
951
951
|
if (err) return onError(err);
|
|
952
952
|
items.forEach(function(item) {
|
|
953
|
-
startCopy($
|
|
953
|
+
startCopy($b70xC$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
|
+
$b70xC$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 = $b70xC$path.resolve(basePath, resolvedPath);
|
|
967
967
|
isWritable(target, function(writable) {
|
|
968
968
|
if (writable) return makeLink(resolvedPath, target);
|
|
969
|
-
$
|
|
969
|
+
$b70xC$fs.readlink(target, function(err, targetDest) {
|
|
970
970
|
if (err) return onError(err);
|
|
971
|
-
if (dereference) targetDest = $
|
|
971
|
+
if (dereference) targetDest = $b70xC$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 $c023d554c0890ceb$var$ncp(source, dest, options, callback) {
|
|
|
977
977
|
});
|
|
978
978
|
}
|
|
979
979
|
function makeLink(linkPath, target) {
|
|
980
|
-
$
|
|
980
|
+
$b70xC$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
|
+
$b70xC$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 $c023d554c0890ceb$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 = $b70xC$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 $c023d554c0890ceb$var$ncp(source, dest, options, callback) {
|
|
|
1016
1016
|
|
|
1017
1017
|
|
|
1018
1018
|
|
|
1019
|
-
var $
|
|
1020
|
-
$
|
|
1019
|
+
var $83f3616b46c3aeac$exports = {};
|
|
1020
|
+
$83f3616b46c3aeac$exports = JSON.parse("{\"name\":\"@atlaspack/fs\",\"version\":\"2.12.1-dev.3443+d1170cfc7\",\"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/core\":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/core\":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/feature-flags\":\"2.12.1-dev.3443+d1170cfc7\",\"@atlaspack/rust\":\"2.12.1-dev.3443+d1170cfc7\",\"@atlaspack/types-internal\":\"2.12.1-dev.3443+d1170cfc7\",\"@atlaspack/utils\":\"2.12.1-dev.3443+d1170cfc7\",\"@atlaspack/workers\":\"2.12.1-dev.3443+d1170cfc7\",\"@parcel/watcher\":\"^2.0.7\"},\"devDependencies\":{\"@atlaspack/watcher-watchman-js\":\"2.12.1-dev.3443+d1170cfc7\",\"graceful-fs\":\"^4.2.4\",\"ncp\":\"^2.0.0\",\"nullthrows\":\"^1.1.1\",\"utility-types\":\"^3.10.0\"},\"peerDependencies\":{\"@atlaspack/core\":\"^2.12.1-dev.3443+d1170cfc7\"},\"browser\":{\"@atlaspack/fs\":\"./lib/browser.js\",\"./src/NodeFS.js\":\"./src/NodeFS.browser.js\"},\"gitHead\":\"d1170cfc79beb290b2a066f472f68f71f7d7cb23\"}");
|
|
1021
1021
|
|
|
1022
1022
|
|
|
1023
1023
|
|
|
1024
1024
|
|
|
1025
|
-
function $
|
|
1026
|
-
let { root: root } = (0, ($parcel$interopDefault($
|
|
1025
|
+
function $ac65417502ef89d5$export$4c6d088a7d7f9947(fs, moduleName, dir) {
|
|
1026
|
+
let { root: root } = (0, ($parcel$interopDefault($b70xC$path))).parse(dir);
|
|
1027
1027
|
while(dir !== root){
|
|
1028
1028
|
// Skip node_modules directories
|
|
1029
|
-
if ((0, ($parcel$interopDefault($
|
|
1029
|
+
if ((0, ($parcel$interopDefault($b70xC$path))).basename(dir) === 'node_modules') dir = (0, ($parcel$interopDefault($b70xC$path))).dirname(dir);
|
|
1030
1030
|
try {
|
|
1031
|
-
let moduleDir = (0, ($parcel$interopDefault($
|
|
1031
|
+
let moduleDir = (0, ($parcel$interopDefault($b70xC$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($b70xC$path))).dirname(dir);
|
|
1039
1039
|
}
|
|
1040
1040
|
return null;
|
|
1041
1041
|
}
|
|
1042
|
-
function $
|
|
1043
|
-
let { root: pathRoot } = (0, ($parcel$interopDefault($
|
|
1042
|
+
function $ac65417502ef89d5$export$d51a93c758976388(fs, fileNames, dir, root) {
|
|
1043
|
+
let { root: pathRoot } = (0, ($parcel$interopDefault($b70xC$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($b70xC$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($b70xC$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 $c5a03bd108f66311$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($b70xC$path))).dirname(dir);
|
|
1057
1057
|
}
|
|
1058
1058
|
return null;
|
|
1059
1059
|
}
|
|
1060
|
-
function $
|
|
1060
|
+
function $ac65417502ef89d5$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,10 +1068,10 @@ function $c5a03bd108f66311$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 $
|
|
1074
|
-
// This is here to trick
|
|
1071
|
+
const $c384d5a91630ebac$var$realpath = (0, $b70xC$util.promisify)(process.platform === 'win32' ? (0, (/*@__PURE__*/$parcel$interopDefault($c9fef47dc93720ea$exports))).realpath : (0, (/*@__PURE__*/$parcel$interopDefault($c9fef47dc93720ea$exports))).realpath.native);
|
|
1072
|
+
const $c384d5a91630ebac$var$isPnP = process.versions.pnp != null;
|
|
1073
|
+
function $c384d5a91630ebac$var$getWatchmanWatcher() {
|
|
1074
|
+
// This is here to trick atlaspack into ignoring this require...
|
|
1075
1075
|
const packageName = [
|
|
1076
1076
|
'@atlaspack',
|
|
1077
1077
|
'watcher-watchman-js'
|
|
@@ -1079,54 +1079,54 @@ function $fd5eb542960b5f45$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 $c384d5a91630ebac$export$c4e0ef2ab73c21e7 {
|
|
1083
|
+
readFile = (0, $b70xC$util.promisify)((0, (/*@__PURE__*/$parcel$interopDefault($c9fef47dc93720ea$exports))).readFile);
|
|
1084
|
+
copyFile = (0, $b70xC$util.promisify)((0, (/*@__PURE__*/$parcel$interopDefault($c9fef47dc93720ea$exports))).copyFile);
|
|
1085
|
+
stat = (0, $b70xC$util.promisify)((0, (/*@__PURE__*/$parcel$interopDefault($c9fef47dc93720ea$exports))).stat);
|
|
1086
|
+
readdir = (0, $b70xC$util.promisify)((0, (/*@__PURE__*/$parcel$interopDefault($c9fef47dc93720ea$exports))).readdir);
|
|
1087
|
+
symlink = (0, $b70xC$util.promisify)((0, (/*@__PURE__*/$parcel$interopDefault($c9fef47dc93720ea$exports))).symlink);
|
|
1088
|
+
unlink = (0, $b70xC$util.promisify)((0, (/*@__PURE__*/$parcel$interopDefault($c9fef47dc93720ea$exports))).unlink);
|
|
1089
|
+
utimes = (0, $b70xC$util.promisify)((0, (/*@__PURE__*/$parcel$interopDefault($c9fef47dc93720ea$exports))).utimes);
|
|
1090
|
+
ncp = (0, $b70xC$util.promisify)((0, (/*@__PURE__*/$parcel$interopDefault($2eff50cbbfc18abd$exports))));
|
|
1091
|
+
createReadStream = (0, (/*@__PURE__*/$parcel$interopDefault($c9fef47dc93720ea$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($c9fef47dc93720ea$exports))).statSync(path);
|
|
1095
|
+
realpathSync = process.platform === 'win32' ? (0, (/*@__PURE__*/$parcel$interopDefault($c9fef47dc93720ea$exports))).realpathSync : (0, (/*@__PURE__*/$parcel$interopDefault($c9fef47dc93720ea$exports))).realpathSync.native;
|
|
1096
|
+
existsSync = (0, (/*@__PURE__*/$parcel$interopDefault($c9fef47dc93720ea$exports))).existsSync;
|
|
1097
|
+
readdirSync = (0, (/*@__PURE__*/$parcel$interopDefault($c9fef47dc93720ea$exports))).readdirSync;
|
|
1098
|
+
findAncestorFile = $c384d5a91630ebac$var$isPnP ? (...args)=>$ac65417502ef89d5$export$d51a93c758976388(this, ...args) : $b70xC$atlaspackrust.findAncestorFile;
|
|
1099
|
+
findNodeModule = $c384d5a91630ebac$var$isPnP ? (...args)=>$ac65417502ef89d5$export$4c6d088a7d7f9947(this, ...args) : $b70xC$atlaspackrust.findNodeModule;
|
|
1100
|
+
findFirstFile = $c384d5a91630ebac$var$isPnP ? (...args)=>$ac65417502ef89d5$export$64df6e3182fd5b2d(this, ...args) : $b70xC$atlaspackrust.findFirstFile;
|
|
1101
1101
|
watcher() {
|
|
1102
|
-
return (0, $
|
|
1102
|
+
return (0, $b70xC$atlaspackfeatureflags.getFeatureFlag)('useWatchmanWatcher') ? $c384d5a91630ebac$var$getWatchmanWatcher() : (0, ($parcel$interopDefault($b70xC$parcelwatcher)));
|
|
1103
1103
|
}
|
|
1104
1104
|
createWriteStream(filePath, options) {
|
|
1105
1105
|
// Make createWriteStream atomic
|
|
1106
|
-
let tmpFilePath = $
|
|
1106
|
+
let tmpFilePath = $c384d5a91630ebac$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($c9fef47dc93720ea$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, $b70xC$atlaspackutils.hashFile)(this, tmpFilePath),
|
|
1117
|
+
(0, $b70xC$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($c9fef47dc93720ea$exports))).createWriteStream(tmpFilePath, {
|
|
1125
1125
|
...options,
|
|
1126
1126
|
fs: {
|
|
1127
|
-
...(0, (/*@__PURE__*/$parcel$interopDefault($
|
|
1127
|
+
...(0, (/*@__PURE__*/$parcel$interopDefault($c9fef47dc93720ea$exports))),
|
|
1128
1128
|
close: (fd, cb)=>{
|
|
1129
|
-
(0, (/*@__PURE__*/$parcel$interopDefault($
|
|
1129
|
+
(0, (/*@__PURE__*/$parcel$interopDefault($c9fef47dc93720ea$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 $fd5eb542960b5f45$export$c4e0ef2ab73c21e7 {
|
|
|
1135
1135
|
});
|
|
1136
1136
|
writeStream.once('error', ()=>{
|
|
1137
1137
|
failed = true;
|
|
1138
|
-
(0, (/*@__PURE__*/$parcel$interopDefault($
|
|
1138
|
+
(0, (/*@__PURE__*/$parcel$interopDefault($c9fef47dc93720ea$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 = $c384d5a91630ebac$var$getTempFilePath(filePath);
|
|
1144
|
+
await (0, (/*@__PURE__*/$parcel$interopDefault($c9fef47dc93720ea$exports))).promises.writeFile(tmpFilePath, contents, options);
|
|
1145
|
+
await (0, (/*@__PURE__*/$parcel$interopDefault($c9fef47dc93720ea$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($c9fef47dc93720ea$exports))).readFileSync(filePath, encoding);
|
|
1149
|
+
return (0, (/*@__PURE__*/$parcel$interopDefault($c9fef47dc93720ea$exports))).readFileSync(filePath);
|
|
1150
1150
|
}
|
|
1151
1151
|
async realpath(originalPath) {
|
|
1152
1152
|
try {
|
|
1153
|
-
return await $
|
|
1153
|
+
return await $c384d5a91630ebac$var$realpath(originalPath, 'utf8');
|
|
1154
1154
|
} catch (e) {
|
|
1155
1155
|
// do nothing
|
|
1156
1156
|
}
|
|
@@ -1158,7 +1158,7 @@ class $fd5eb542960b5f45$export$c4e0ef2ab73c21e7 {
|
|
|
1158
1158
|
}
|
|
1159
1159
|
exists(filePath) {
|
|
1160
1160
|
return new Promise((resolve)=>{
|
|
1161
|
-
(0, (/*@__PURE__*/$parcel$interopDefault($
|
|
1161
|
+
(0, (/*@__PURE__*/$parcel$interopDefault($c9fef47dc93720ea$exports))).exists(filePath, resolve);
|
|
1162
1162
|
});
|
|
1163
1163
|
}
|
|
1164
1164
|
watch(dir, fn, opts) {
|
|
@@ -1171,19 +1171,19 @@ class $fd5eb542960b5f45$export$c4e0ef2ab73c21e7 {
|
|
|
1171
1171
|
await this.watcher().writeSnapshot(dir, snapshot, opts);
|
|
1172
1172
|
}
|
|
1173
1173
|
static deserialize() {
|
|
1174
|
-
return new $
|
|
1174
|
+
return new $c384d5a91630ebac$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($b70xC$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($c9fef47dc93720ea$exports))).promises.rm) {
|
|
1186
|
+
await (0, (/*@__PURE__*/$parcel$interopDefault($c9fef47dc93720ea$exports))).promises.rm(filePath, {
|
|
1187
1187
|
recursive: true,
|
|
1188
1188
|
force: true
|
|
1189
1189
|
});
|
|
@@ -1197,117 +1197,117 @@ class $fd5eb542960b5f45$export$c4e0ef2ab73c21e7 {
|
|
|
1197
1197
|
return;
|
|
1198
1198
|
}
|
|
1199
1199
|
if (stat.isDirectory()) // $FlowFixMe
|
|
1200
|
-
await (0, ($parcel$interopDefault($
|
|
1200
|
+
await (0, ($parcel$interopDefault($b70xC$fs))).promises.rmdir(filePath, {
|
|
1201
1201
|
recursive: true
|
|
1202
1202
|
});
|
|
1203
|
-
else await (0, ($parcel$interopDefault($
|
|
1203
|
+
else await (0, ($parcel$interopDefault($b70xC$fs))).promises.unlink(filePath);
|
|
1204
1204
|
}
|
|
1205
1205
|
}
|
|
1206
|
-
(0, $
|
|
1207
|
-
let $
|
|
1208
|
-
let $
|
|
1206
|
+
(0, $b70xC$atlaspackcore.registerSerializableClass)(`${(0, (/*@__PURE__*/$parcel$interopDefault($83f3616b46c3aeac$exports))).version}:NodeFS`, $c384d5a91630ebac$export$c4e0ef2ab73c21e7);
|
|
1207
|
+
let $c384d5a91630ebac$var$writeStreamCalls = 0;
|
|
1208
|
+
let $c384d5a91630ebac$var$threadId;
|
|
1209
1209
|
|
|
1210
1210
|
try {
|
|
1211
|
-
({ threadId: $
|
|
1211
|
+
({ threadId: $c384d5a91630ebac$var$threadId } = $c384d5a91630ebac$import$9c2ae04019a9b9e3);
|
|
1212
1212
|
} catch {
|
|
1213
1213
|
//
|
|
1214
1214
|
}
|
|
1215
|
-
let $
|
|
1216
|
-
function $
|
|
1217
|
-
if ($
|
|
1215
|
+
let $c384d5a91630ebac$var$useOsTmpDir;
|
|
1216
|
+
function $c384d5a91630ebac$var$shouldUseOsTmpDir(filePath) {
|
|
1217
|
+
if ($c384d5a91630ebac$var$useOsTmpDir != null) return $c384d5a91630ebac$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, $b70xC$os.tmpdir)();
|
|
1220
|
+
(0, ($parcel$interopDefault($b70xC$fs))).accessSync(tmpDir, (0, ($parcel$interopDefault($b70xC$fs))).constants.R_OK | (0, ($parcel$interopDefault($b70xC$fs))).constants.W_OK);
|
|
1221
|
+
const tmpDirStats = (0, ($parcel$interopDefault($b70xC$fs))).statSync(tmpDir);
|
|
1222
|
+
const filePathStats = (0, ($parcel$interopDefault($b70xC$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
|
+
$c384d5a91630ebac$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
|
+
$c384d5a91630ebac$var$useOsTmpDir = false;
|
|
1229
1229
|
}
|
|
1230
|
-
return $
|
|
1230
|
+
return $c384d5a91630ebac$var$useOsTmpDir;
|
|
1231
1231
|
}
|
|
1232
1232
|
// Generate a temporary file path used for atomic writing of files.
|
|
1233
|
-
function $
|
|
1234
|
-
$
|
|
1233
|
+
function $c384d5a91630ebac$var$getTempFilePath(filePath) {
|
|
1234
|
+
$c384d5a91630ebac$var$writeStreamCalls = $c384d5a91630ebac$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 ($c384d5a91630ebac$var$shouldUseOsTmpDir(filePath)) tmpFilePath = (0, ($parcel$interopDefault($b70xC$path))).join((0, $b70xC$os.tmpdir)(), (0, ($parcel$interopDefault($b70xC$path))).basename(filePath));
|
|
1239
|
+
return tmpFilePath + '.' + process.pid + ($c384d5a91630ebac$var$threadId != null ? '.' + $c384d5a91630ebac$var$threadId : '') + '.' + ($c384d5a91630ebac$var$writeStreamCalls++).toString(36);
|
|
1240
1240
|
}
|
|
1241
1241
|
|
|
1242
1242
|
|
|
1243
|
-
var $
|
|
1243
|
+
var $b04b349429406f05$exports = {};
|
|
1244
1244
|
|
|
1245
|
-
$parcel$export($
|
|
1246
|
-
$parcel$export($
|
|
1247
|
-
$parcel$export($
|
|
1248
|
-
$parcel$export($
|
|
1245
|
+
$parcel$export($b04b349429406f05$exports, "MemoryFS", () => $b04b349429406f05$export$3048eb7ec07c2c4e);
|
|
1246
|
+
$parcel$export($b04b349429406f05$exports, "FSError", () => $b04b349429406f05$export$d414276624ebf134);
|
|
1247
|
+
$parcel$export($b04b349429406f05$exports, "makeShared", () => $b04b349429406f05$export$df9eb3e75aa27a22);
|
|
1248
|
+
$parcel$export($b04b349429406f05$exports, "File", () => $b04b349429406f05$export$b6afa8811b7e644e);
|
|
1249
1249
|
|
|
1250
1250
|
|
|
1251
1251
|
|
|
1252
1252
|
|
|
1253
1253
|
|
|
1254
1254
|
|
|
1255
|
-
var $
|
|
1255
|
+
var $3051564421295753$exports = {};
|
|
1256
1256
|
'use strict';
|
|
1257
|
-
function $
|
|
1257
|
+
function $3051564421295753$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
|
+
$3051564421295753$exports = $3051564421295753$var$nullthrows;
|
|
1264
|
+
$3051564421295753$exports.default = $3051564421295753$var$nullthrows;
|
|
1265
|
+
Object.defineProperty($3051564421295753$exports, '__esModule', {
|
|
1266
1266
|
value: true
|
|
1267
1267
|
});
|
|
1268
1268
|
|
|
1269
1269
|
|
|
1270
1270
|
|
|
1271
1271
|
|
|
1272
|
-
const $
|
|
1273
|
-
let $
|
|
1274
|
-
class $
|
|
1272
|
+
const $b04b349429406f05$var$instances = new Map();
|
|
1273
|
+
let $b04b349429406f05$var$id = 0;
|
|
1274
|
+
class $b04b349429406f05$export$3048eb7ec07c2c4e {
|
|
1275
1275
|
_numWorkerInstances = 0;
|
|
1276
1276
|
_workerRegisterResolves = [];
|
|
1277
|
-
_emitter = new (0, ($parcel$interopDefault($
|
|
1277
|
+
_emitter = new (0, ($parcel$interopDefault($b70xC$events)))();
|
|
1278
1278
|
constructor(workerFarm){
|
|
1279
1279
|
this.farm = workerFarm;
|
|
1280
|
-
this._cwd = (0, ($parcel$interopDefault($
|
|
1280
|
+
this._cwd = (0, ($parcel$interopDefault($b70xC$path))).resolve((0, ($parcel$interopDefault($b70xC$path))).sep);
|
|
1281
1281
|
this.dirs = new Map([
|
|
1282
1282
|
[
|
|
1283
1283
|
this._cwd,
|
|
1284
|
-
new $
|
|
1284
|
+
new $b04b349429406f05$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 = $b04b349429406f05$var$id++;
|
|
1292
1292
|
this._workerHandles = [];
|
|
1293
1293
|
this._eventQueue = [];
|
|
1294
|
-
$
|
|
1294
|
+
$b04b349429406f05$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 = $b04b349429406f05$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($b70xC$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 $b04b349429406f05$var$WorkerFS(opts.id, (0, (/*@__PURE__*/$parcel$interopDefault($3051564421295753$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 $7b991d7841c5927f$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($b70xC$path))).normalize(filePath);
|
|
1344
|
+
if (!filePath.startsWith(this.cwd())) filePath = (0, ($parcel$interopDefault($b70xC$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($b70xC$path))).parse(filePath);
|
|
1348
|
+
let parts = dir.slice(root.length).split((0, ($parcel$interopDefault($b70xC$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($b70xC$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 $7b991d7841c5927f$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 $b04b349429406f05$export$d414276624ebf134('EISDIR', filePath, 'is a directory');
|
|
1362
|
+
let dir = (0, ($parcel$interopDefault($b70xC$path))).dirname(filePath);
|
|
1363
|
+
if (!this.dirs.has(dir)) throw new $b04b349429406f05$export$d414276624ebf134('ENOENT', dir, 'does not exist');
|
|
1364
|
+
let buffer = $b04b349429406f05$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 $b04b349429406f05$export$b6afa8811b7e644e(buffer, mode));
|
|
1371
1371
|
await this._sendWorkerEvent({
|
|
1372
1372
|
type: 'writeFile',
|
|
1373
1373
|
path: filePath,
|
|
@@ -1385,7 +1385,7 @@ class $7b991d7841c5927f$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 $b04b349429406f05$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 $7b991d7841c5927f$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 $b04b349429406f05$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 $7b991d7841c5927f$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 $b04b349429406f05$export$d414276624ebf134('ENOENT', dir, 'does not exist');
|
|
1412
|
+
if (!dir.endsWith((0, ($parcel$interopDefault($b70xC$path))).sep)) dir += (0, ($parcel$interopDefault($b70xC$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($b70xC$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 $b04b349429406f05$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($b70xC$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 $b04b349429406f05$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($b70xC$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 $b04b349429406f05$var$Dirent(name, {
|
|
1430
|
+
mode: $b04b349429406f05$var$S_IFLNK
|
|
1431
1431
|
}));
|
|
1432
1432
|
else res.push(name);
|
|
1433
1433
|
}
|
|
@@ -1439,7 +1439,7 @@ class $7b991d7841c5927f$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 $b04b349429406f05$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 $7b991d7841c5927f$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 $b04b349429406f05$export$d414276624ebf134('ENOENT', dir, 'is not a directory');
|
|
1460
|
+
let root = (0, ($parcel$interopDefault($b70xC$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 $b04b349429406f05$var$Directory());
|
|
1464
1464
|
await this._sendWorkerEvent({
|
|
1465
1465
|
type: 'mkdir',
|
|
1466
1466
|
path: dir
|
|
@@ -1469,14 +1469,14 @@ class $7b991d7841c5927f$export$3048eb7ec07c2c4e {
|
|
|
1469
1469
|
type: 'create',
|
|
1470
1470
|
path: dir
|
|
1471
1471
|
});
|
|
1472
|
-
dir = (0, ($parcel$interopDefault($
|
|
1472
|
+
dir = (0, ($parcel$interopDefault($b70xC$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($b70xC$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 $7b991d7841c5927f$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 $b04b349429406f05$var$Directory());
|
|
1537
1537
|
await this._sendWorkerEvent({
|
|
1538
1538
|
type: 'mkdir',
|
|
1539
1539
|
path: destination
|
|
@@ -1543,11 +1543,11 @@ class $7b991d7841c5927f$export$3048eb7ec07c2c4e {
|
|
|
1543
1543
|
path: destination
|
|
1544
1544
|
});
|
|
1545
1545
|
}
|
|
1546
|
-
let dir = source + (0, ($parcel$interopDefault($
|
|
1546
|
+
let dir = source + (0, ($parcel$interopDefault($b70xC$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($b70xC$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 $b04b349429406f05$var$Directory());
|
|
1551
1551
|
await this._sendWorkerEvent({
|
|
1552
1552
|
type: 'mkdir',
|
|
1553
1553
|
path: destination
|
|
@@ -1559,7 +1559,7 @@ class $7b991d7841c5927f$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($b70xC$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 $7b991d7841c5927f$export$3048eb7ec07c2c4e {
|
|
|
1575
1575
|
} else await this.copyFile(source, destination);
|
|
1576
1576
|
}
|
|
1577
1577
|
createReadStream(filePath) {
|
|
1578
|
-
return new $
|
|
1578
|
+
return new $b04b349429406f05$var$ReadStream(this, filePath);
|
|
1579
1579
|
}
|
|
1580
1580
|
createWriteStream(filePath, options) {
|
|
1581
|
-
return new $
|
|
1581
|
+
return new $b04b349429406f05$var$WriteStream(this, filePath, options);
|
|
1582
1582
|
}
|
|
1583
1583
|
realpathSync(filePath) {
|
|
1584
1584
|
return this._normalizePath(filePath);
|
|
@@ -1615,7 +1615,7 @@ class $7b991d7841c5927f$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($b70xC$path))).sep)) dir += (0, ($parcel$interopDefault($b70xC$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 $7b991d7841c5927f$export$3048eb7ec07c2c4e {
|
|
|
1633
1633
|
}
|
|
1634
1634
|
watch(dir, fn, opts) {
|
|
1635
1635
|
dir = this._normalizePath(dir);
|
|
1636
|
-
let watcher = new $
|
|
1636
|
+
let watcher = new $b04b349429406f05$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 $7b991d7841c5927f$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($3051564421295753$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,34 @@ class $7b991d7841c5927f$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($b70xC$path))).sep)));
|
|
1658
1658
|
return events;
|
|
1659
1659
|
}
|
|
1660
1660
|
async writeSnapshot(dir, snapshot) {
|
|
1661
1661
|
await this.writeFile(snapshot, '' + this.events.length);
|
|
1662
1662
|
}
|
|
1663
1663
|
findAncestorFile(fileNames, fromDir, root) {
|
|
1664
|
-
return (0, $
|
|
1664
|
+
return (0, $ac65417502ef89d5$export$d51a93c758976388)(this, fileNames, fromDir, root);
|
|
1665
1665
|
}
|
|
1666
1666
|
findNodeModule(moduleName, fromDir) {
|
|
1667
|
-
return (0, $
|
|
1667
|
+
return (0, $ac65417502ef89d5$export$4c6d088a7d7f9947)(this, moduleName, fromDir);
|
|
1668
1668
|
}
|
|
1669
1669
|
findFirstFile(filePaths) {
|
|
1670
|
-
return (0, $
|
|
1670
|
+
return (0, $ac65417502ef89d5$export$64df6e3182fd5b2d)(this, filePaths);
|
|
1671
1671
|
}
|
|
1672
1672
|
}
|
|
1673
|
-
class $
|
|
1673
|
+
class $b04b349429406f05$var$Watcher {
|
|
1674
1674
|
constructor(fn, options){
|
|
1675
1675
|
this.fn = fn;
|
|
1676
1676
|
this.options = options;
|
|
1677
1677
|
}
|
|
1678
1678
|
trigger(events) {
|
|
1679
1679
|
let ignore = this.options.ignore;
|
|
1680
|
-
if (ignore) events = events.filter((event)=>!ignore.some((i)=>event.path.startsWith(i + (0, ($parcel$interopDefault($
|
|
1680
|
+
if (ignore) events = events.filter((event)=>!ignore.some((i)=>event.path.startsWith(i + (0, ($parcel$interopDefault($b70xC$path))).sep)));
|
|
1681
1681
|
if (events.length > 0) this.fn(null, events);
|
|
1682
1682
|
}
|
|
1683
1683
|
}
|
|
1684
|
-
class $
|
|
1684
|
+
class $b04b349429406f05$export$d414276624ebf134 extends Error {
|
|
1685
1685
|
constructor(code, path, message){
|
|
1686
1686
|
super(`${code}: ${path} ${message}`);
|
|
1687
1687
|
this.name = 'FSError';
|
|
@@ -1690,7 +1690,7 @@ class $7b991d7841c5927f$export$d414276624ebf134 extends Error {
|
|
|
1690
1690
|
Error.captureStackTrace?.(this, this.constructor);
|
|
1691
1691
|
}
|
|
1692
1692
|
}
|
|
1693
|
-
class $
|
|
1693
|
+
class $b04b349429406f05$var$ReadStream extends (0, $b70xC$stream.Readable) {
|
|
1694
1694
|
constructor(fs, filePath){
|
|
1695
1695
|
super();
|
|
1696
1696
|
this.fs = fs;
|
|
@@ -1710,7 +1710,7 @@ class $7b991d7841c5927f$var$ReadStream extends (0, $dlC2Z$stream.Readable) {
|
|
|
1710
1710
|
});
|
|
1711
1711
|
}
|
|
1712
1712
|
}
|
|
1713
|
-
class $
|
|
1713
|
+
class $b04b349429406f05$var$WriteStream extends (0, $b70xC$stream.Writable) {
|
|
1714
1714
|
constructor(fs, filePath, options){
|
|
1715
1715
|
super({
|
|
1716
1716
|
emitClose: true,
|
|
@@ -1733,11 +1733,11 @@ class $7b991d7841c5927f$var$WriteStream extends (0, $dlC2Z$stream.Writable) {
|
|
|
1733
1733
|
this.fs.writeFile(this.filePath, this.buffer, this.options).then(callback).catch(callback);
|
|
1734
1734
|
}
|
|
1735
1735
|
}
|
|
1736
|
-
const $
|
|
1737
|
-
const $
|
|
1738
|
-
const $
|
|
1739
|
-
const $
|
|
1740
|
-
class $
|
|
1736
|
+
const $b04b349429406f05$var$S_IFREG = 32768;
|
|
1737
|
+
const $b04b349429406f05$var$S_IFDIR = 16384;
|
|
1738
|
+
const $b04b349429406f05$var$S_IFLNK = 40960;
|
|
1739
|
+
const $b04b349429406f05$var$S_IFMT = 61440;
|
|
1740
|
+
class $b04b349429406f05$var$Entry {
|
|
1741
1741
|
constructor(mode){
|
|
1742
1742
|
this.mode = mode;
|
|
1743
1743
|
let now = Date.now();
|
|
@@ -1761,10 +1761,10 @@ class $7b991d7841c5927f$var$Entry {
|
|
|
1761
1761
|
return 0;
|
|
1762
1762
|
}
|
|
1763
1763
|
stat() {
|
|
1764
|
-
return new $
|
|
1764
|
+
return new $b04b349429406f05$var$Stat(this);
|
|
1765
1765
|
}
|
|
1766
1766
|
}
|
|
1767
|
-
class $
|
|
1767
|
+
class $b04b349429406f05$var$Stat {
|
|
1768
1768
|
dev = 0;
|
|
1769
1769
|
ino = 0;
|
|
1770
1770
|
nlink = 0;
|
|
@@ -1786,10 +1786,10 @@ class $7b991d7841c5927f$var$Stat {
|
|
|
1786
1786
|
this.birthtime = new Date(entry.birthtime);
|
|
1787
1787
|
}
|
|
1788
1788
|
isFile() {
|
|
1789
|
-
return Boolean(this.mode & $
|
|
1789
|
+
return Boolean(this.mode & $b04b349429406f05$var$S_IFREG);
|
|
1790
1790
|
}
|
|
1791
1791
|
isDirectory() {
|
|
1792
|
-
return Boolean(this.mode & $
|
|
1792
|
+
return Boolean(this.mode & $b04b349429406f05$var$S_IFDIR);
|
|
1793
1793
|
}
|
|
1794
1794
|
isBlockDevice() {
|
|
1795
1795
|
return false;
|
|
@@ -1807,17 +1807,17 @@ class $7b991d7841c5927f$var$Stat {
|
|
|
1807
1807
|
return false;
|
|
1808
1808
|
}
|
|
1809
1809
|
}
|
|
1810
|
-
class $
|
|
1810
|
+
class $b04b349429406f05$var$Dirent {
|
|
1811
1811
|
#mode;
|
|
1812
1812
|
constructor(name, entry){
|
|
1813
1813
|
this.name = name;
|
|
1814
1814
|
this.#mode = entry.mode;
|
|
1815
1815
|
}
|
|
1816
1816
|
isFile() {
|
|
1817
|
-
return (this.#mode & $
|
|
1817
|
+
return (this.#mode & $b04b349429406f05$var$S_IFMT) === $b04b349429406f05$var$S_IFREG;
|
|
1818
1818
|
}
|
|
1819
1819
|
isDirectory() {
|
|
1820
|
-
return (this.#mode & $
|
|
1820
|
+
return (this.#mode & $b04b349429406f05$var$S_IFMT) === $b04b349429406f05$var$S_IFDIR;
|
|
1821
1821
|
}
|
|
1822
1822
|
isBlockDevice() {
|
|
1823
1823
|
return false;
|
|
@@ -1826,7 +1826,7 @@ class $7b991d7841c5927f$var$Dirent {
|
|
|
1826
1826
|
return false;
|
|
1827
1827
|
}
|
|
1828
1828
|
isSymbolicLink() {
|
|
1829
|
-
return (this.#mode & $
|
|
1829
|
+
return (this.#mode & $b04b349429406f05$var$S_IFMT) === $b04b349429406f05$var$S_IFLNK;
|
|
1830
1830
|
}
|
|
1831
1831
|
isFIFO() {
|
|
1832
1832
|
return false;
|
|
@@ -1835,9 +1835,9 @@ class $7b991d7841c5927f$var$Dirent {
|
|
|
1835
1835
|
return false;
|
|
1836
1836
|
}
|
|
1837
1837
|
}
|
|
1838
|
-
class $
|
|
1838
|
+
class $b04b349429406f05$export$b6afa8811b7e644e extends $b04b349429406f05$var$Entry {
|
|
1839
1839
|
constructor(buffer, mode){
|
|
1840
|
-
super($
|
|
1840
|
+
super($b04b349429406f05$var$S_IFREG | mode);
|
|
1841
1841
|
this.buffer = buffer;
|
|
1842
1842
|
}
|
|
1843
1843
|
read() {
|
|
@@ -1845,27 +1845,27 @@ class $7b991d7841c5927f$export$b6afa8811b7e644e extends $7b991d7841c5927f$var$En
|
|
|
1845
1845
|
return Buffer.from(this.buffer);
|
|
1846
1846
|
}
|
|
1847
1847
|
write(buffer, mode) {
|
|
1848
|
-
super.modify($
|
|
1848
|
+
super.modify($b04b349429406f05$var$S_IFREG | mode);
|
|
1849
1849
|
this.buffer = buffer;
|
|
1850
1850
|
}
|
|
1851
1851
|
getSize() {
|
|
1852
1852
|
return this.buffer.byteLength;
|
|
1853
1853
|
}
|
|
1854
1854
|
}
|
|
1855
|
-
class $
|
|
1855
|
+
class $b04b349429406f05$var$Directory extends $b04b349429406f05$var$Entry {
|
|
1856
1856
|
constructor(){
|
|
1857
|
-
super($
|
|
1857
|
+
super($b04b349429406f05$var$S_IFDIR);
|
|
1858
1858
|
}
|
|
1859
1859
|
}
|
|
1860
|
-
function $
|
|
1861
|
-
if (typeof contents !== 'string' && contents.buffer instanceof (0, $
|
|
1860
|
+
function $b04b349429406f05$export$df9eb3e75aa27a22(contents) {
|
|
1861
|
+
if (typeof contents !== 'string' && contents.buffer instanceof (0, $b70xC$atlaspackutils.SharedBuffer)) return contents;
|
|
1862
1862
|
let contentsBuffer = contents;
|
|
1863
1863
|
// $FlowFixMe
|
|
1864
1864
|
if (process.browser) // For the polyfilled buffer module, it's faster to always convert once so that the subsequent
|
|
1865
1865
|
// operations are fast (.byteLength and using .set instead of .write)
|
|
1866
1866
|
contentsBuffer = contentsBuffer instanceof Buffer ? contentsBuffer : Buffer.from(contentsBuffer);
|
|
1867
1867
|
let length = Buffer.byteLength(contentsBuffer);
|
|
1868
|
-
let shared = new (0, $
|
|
1868
|
+
let shared = new (0, $b70xC$atlaspackutils.SharedBuffer)(length);
|
|
1869
1869
|
let buffer = Buffer.from(shared);
|
|
1870
1870
|
if (length > 0) {
|
|
1871
1871
|
if (typeof contentsBuffer === 'string') buffer.write(contentsBuffer);
|
|
@@ -1873,18 +1873,18 @@ function $7b991d7841c5927f$export$df9eb3e75aa27a22(contents) {
|
|
|
1873
1873
|
}
|
|
1874
1874
|
return buffer;
|
|
1875
1875
|
}
|
|
1876
|
-
class $
|
|
1876
|
+
class $b04b349429406f05$var$WorkerFS extends $b04b349429406f05$export$3048eb7ec07c2c4e {
|
|
1877
1877
|
constructor(id, handle){
|
|
1878
1878
|
// TODO Make this not a subclass
|
|
1879
1879
|
// $FlowFixMe
|
|
1880
1880
|
super();
|
|
1881
1881
|
this.id = id;
|
|
1882
|
-
this.handleFn = (methodName, args)=>(0, ($parcel$interopDefault($
|
|
1882
|
+
this.handleFn = (methodName, args)=>(0, ($parcel$interopDefault($b70xC$atlaspackworkers))).getWorkerApi().runHandle(handle, [
|
|
1883
1883
|
methodName,
|
|
1884
1884
|
args
|
|
1885
1885
|
]);
|
|
1886
1886
|
this.handleFn('_registerWorker', [
|
|
1887
|
-
(0, ($parcel$interopDefault($
|
|
1887
|
+
(0, ($parcel$interopDefault($b70xC$atlaspackworkers))).getWorkerApi().createReverseHandle((event)=>{
|
|
1888
1888
|
switch(event.type){
|
|
1889
1889
|
case 'writeFile':
|
|
1890
1890
|
this.files.set(event.path, event.entry);
|
|
@@ -1895,7 +1895,7 @@ class $7b991d7841c5927f$var$WorkerFS extends $7b991d7841c5927f$export$3048eb7ec0
|
|
|
1895
1895
|
this.symlinks.delete(event.path);
|
|
1896
1896
|
break;
|
|
1897
1897
|
case 'mkdir':
|
|
1898
|
-
this.dirs.set(event.path, new $
|
|
1898
|
+
this.dirs.set(event.path, new $b04b349429406f05$var$Directory());
|
|
1899
1899
|
break;
|
|
1900
1900
|
case 'symlink':
|
|
1901
1901
|
this.symlinks.set(event.path, event.target);
|
|
@@ -1905,7 +1905,7 @@ class $7b991d7841c5927f$var$WorkerFS extends $7b991d7841c5927f$export$3048eb7ec0
|
|
|
1905
1905
|
]);
|
|
1906
1906
|
}
|
|
1907
1907
|
static deserialize(opts) {
|
|
1908
|
-
return (0, (/*@__PURE__*/$parcel$interopDefault($
|
|
1908
|
+
return (0, (/*@__PURE__*/$parcel$interopDefault($3051564421295753$exports)))($b04b349429406f05$var$instances.get(opts.id));
|
|
1909
1909
|
}
|
|
1910
1910
|
serialize() {
|
|
1911
1911
|
// $FlowFixMe
|
|
@@ -1915,7 +1915,7 @@ class $7b991d7841c5927f$var$WorkerFS extends $7b991d7841c5927f$export$3048eb7ec0
|
|
|
1915
1915
|
}
|
|
1916
1916
|
writeFile(filePath, contents, options) {
|
|
1917
1917
|
super.writeFile(filePath, contents, options);
|
|
1918
|
-
let buffer = $
|
|
1918
|
+
let buffer = $b04b349429406f05$export$df9eb3e75aa27a22(contents);
|
|
1919
1919
|
return this.handleFn('writeFile', [
|
|
1920
1920
|
filePath,
|
|
1921
1921
|
buffer,
|
|
@@ -1955,16 +1955,16 @@ class $7b991d7841c5927f$var$WorkerFS extends $7b991d7841c5927f$export$3048eb7ec0
|
|
|
1955
1955
|
]);
|
|
1956
1956
|
}
|
|
1957
1957
|
}
|
|
1958
|
-
(0, $
|
|
1959
|
-
(0, $
|
|
1960
|
-
(0, $
|
|
1961
|
-
(0, $
|
|
1962
|
-
(0, $
|
|
1958
|
+
(0, $b70xC$atlaspackcore.registerSerializableClass)(`${(0, (/*@__PURE__*/$parcel$interopDefault($83f3616b46c3aeac$exports))).version}:MemoryFS`, $b04b349429406f05$export$3048eb7ec07c2c4e);
|
|
1959
|
+
(0, $b70xC$atlaspackcore.registerSerializableClass)(`${(0, (/*@__PURE__*/$parcel$interopDefault($83f3616b46c3aeac$exports))).version}:WorkerFS`, $b04b349429406f05$var$WorkerFS);
|
|
1960
|
+
(0, $b70xC$atlaspackcore.registerSerializableClass)(`${(0, (/*@__PURE__*/$parcel$interopDefault($83f3616b46c3aeac$exports))).version}:Stat`, $b04b349429406f05$var$Stat);
|
|
1961
|
+
(0, $b70xC$atlaspackcore.registerSerializableClass)(`${(0, (/*@__PURE__*/$parcel$interopDefault($83f3616b46c3aeac$exports))).version}:File`, $b04b349429406f05$export$b6afa8811b7e644e);
|
|
1962
|
+
(0, $b70xC$atlaspackcore.registerSerializableClass)(`${(0, (/*@__PURE__*/$parcel$interopDefault($83f3616b46c3aeac$exports))).version}:Directory`, $b04b349429406f05$var$Directory);
|
|
1963
1963
|
|
|
1964
1964
|
|
|
1965
|
-
var $
|
|
1965
|
+
var $ec29e7a1a330544d$exports = {};
|
|
1966
1966
|
|
|
1967
|
-
$parcel$export($
|
|
1967
|
+
$parcel$export($ec29e7a1a330544d$exports, "OverlayFS", () => $ec29e7a1a330544d$export$5963299e2424ca1c);
|
|
1968
1968
|
|
|
1969
1969
|
|
|
1970
1970
|
|
|
@@ -1972,16 +1972,16 @@ $parcel$export($994c93c6792b2070$exports, "OverlayFS", () => $994c93c6792b2070$e
|
|
|
1972
1972
|
|
|
1973
1973
|
|
|
1974
1974
|
|
|
1975
|
-
class $
|
|
1975
|
+
class $ec29e7a1a330544d$export$5963299e2424ca1c {
|
|
1976
1976
|
deleted = new Set();
|
|
1977
1977
|
constructor(workerFarmOrFS, readable){
|
|
1978
|
-
if (workerFarmOrFS instanceof (0, ($parcel$interopDefault($
|
|
1978
|
+
if (workerFarmOrFS instanceof (0, ($parcel$interopDefault($b70xC$atlaspackworkers)))) this.writable = new (0, $b04b349429406f05$export$3048eb7ec07c2c4e)(workerFarmOrFS);
|
|
1979
1979
|
else this.writable = workerFarmOrFS;
|
|
1980
1980
|
this.readable = readable;
|
|
1981
1981
|
this._cwd = readable.cwd();
|
|
1982
1982
|
}
|
|
1983
1983
|
static deserialize(opts) {
|
|
1984
|
-
let fs = new $
|
|
1984
|
+
let fs = new $ec29e7a1a330544d$export$5963299e2424ca1c(opts.writable, opts.readable);
|
|
1985
1985
|
if (opts.deleted != null) fs.deleted = opts.deleted;
|
|
1986
1986
|
return fs;
|
|
1987
1987
|
}
|
|
@@ -1995,28 +1995,28 @@ class $994c93c6792b2070$export$5963299e2424ca1c {
|
|
|
1995
1995
|
}
|
|
1996
1996
|
_deletedThrows(filePath) {
|
|
1997
1997
|
filePath = this._normalizePath(filePath);
|
|
1998
|
-
if (this.deleted.has(filePath)) throw new $
|
|
1998
|
+
if (this.deleted.has(filePath)) throw new $ec29e7a1a330544d$var$FSError('ENOENT', filePath, 'does not exist');
|
|
1999
1999
|
return filePath;
|
|
2000
2000
|
}
|
|
2001
2001
|
_checkExists(filePath) {
|
|
2002
2002
|
filePath = this._deletedThrows(filePath);
|
|
2003
|
-
if (!this.existsSync(filePath)) throw new $
|
|
2003
|
+
if (!this.existsSync(filePath)) throw new $ec29e7a1a330544d$var$FSError('ENOENT', filePath, 'does not exist');
|
|
2004
2004
|
return filePath;
|
|
2005
2005
|
}
|
|
2006
2006
|
_isSymlink(filePath) {
|
|
2007
2007
|
filePath = this._normalizePath(filePath);
|
|
2008
2008
|
// 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($
|
|
2009
|
+
let { root: root, dir: dir, base: base } = (0, ($parcel$interopDefault($b70xC$path))).parse(filePath);
|
|
2010
|
+
let segments = dir.slice(root.length).split((0, ($parcel$interopDefault($b70xC$path))).sep).concat(base);
|
|
2011
2011
|
while(segments.length){
|
|
2012
|
-
filePath = (0, ($parcel$interopDefault($
|
|
2012
|
+
filePath = (0, ($parcel$interopDefault($b70xC$path))).join(root, ...segments);
|
|
2013
2013
|
let name = segments.pop();
|
|
2014
2014
|
if (this.deleted.has(filePath)) return false;
|
|
2015
|
-
else if (this.writable instanceof (0, $
|
|
2015
|
+
else if (this.writable instanceof (0, $b04b349429406f05$export$3048eb7ec07c2c4e) && this.writable.symlinks.has(filePath)) return true;
|
|
2016
2016
|
else {
|
|
2017
|
-
// HACK:
|
|
2017
|
+
// HACK: Atlaspack fs does not provide `lstatSync`,
|
|
2018
2018
|
// so we use `readdirSync` to check if the path is a symlink.
|
|
2019
|
-
let parent = (0, ($parcel$interopDefault($
|
|
2019
|
+
let parent = (0, ($parcel$interopDefault($b70xC$path))).resolve(filePath, '..');
|
|
2020
2020
|
if (parent === filePath) return false;
|
|
2021
2021
|
try {
|
|
2022
2022
|
for (let dirent of this.readdirSync(parent, {
|
|
@@ -2037,12 +2037,12 @@ class $994c93c6792b2070$export$5963299e2424ca1c {
|
|
|
2037
2037
|
}
|
|
2038
2038
|
async _copyPathForWrite(filePath) {
|
|
2039
2039
|
filePath = await this._normalizePath(filePath);
|
|
2040
|
-
let dirPath = (0, ($parcel$interopDefault($
|
|
2040
|
+
let dirPath = (0, ($parcel$interopDefault($b70xC$path))).dirname(filePath);
|
|
2041
2041
|
if (this.existsSync(dirPath) && !this.writable.existsSync(dirPath)) await this.writable.mkdirp(dirPath);
|
|
2042
2042
|
return filePath;
|
|
2043
2043
|
}
|
|
2044
2044
|
_normalizePath(filePath) {
|
|
2045
|
-
return (0, ($parcel$interopDefault($
|
|
2045
|
+
return (0, ($parcel$interopDefault($b70xC$path))).resolve(this.cwd(), filePath);
|
|
2046
2046
|
}
|
|
2047
2047
|
// eslint-disable-next-line require-await
|
|
2048
2048
|
async readFile(filePath, encoding) {
|
|
@@ -2075,22 +2075,22 @@ class $994c93c6792b2070$export$5963299e2424ca1c {
|
|
|
2075
2075
|
let toDelete = [
|
|
2076
2076
|
filePath
|
|
2077
2077
|
];
|
|
2078
|
-
if (this.writable instanceof (0, $
|
|
2078
|
+
if (this.writable instanceof (0, $b04b349429406f05$export$3048eb7ec07c2c4e) && this._isSymlink(filePath)) this.writable.symlinks.delete(filePath);
|
|
2079
2079
|
else if (this.statSync(filePath).isDirectory()) {
|
|
2080
2080
|
let stack = [
|
|
2081
2081
|
filePath
|
|
2082
2082
|
];
|
|
2083
2083
|
// Recursively add every descendant path to deleted.
|
|
2084
2084
|
while(stack.length){
|
|
2085
|
-
let root = (0, (/*@__PURE__*/$parcel$interopDefault($
|
|
2085
|
+
let root = (0, (/*@__PURE__*/$parcel$interopDefault($3051564421295753$exports)))(stack.pop());
|
|
2086
2086
|
for (let ent of this.readdirSync(root, {
|
|
2087
2087
|
withFileTypes: true
|
|
2088
2088
|
}))if (typeof ent === 'string') {
|
|
2089
|
-
let childPath = (0, ($parcel$interopDefault($
|
|
2089
|
+
let childPath = (0, ($parcel$interopDefault($b70xC$path))).join(root, ent);
|
|
2090
2090
|
toDelete.push(childPath);
|
|
2091
2091
|
if (this.statSync(childPath).isDirectory()) stack.push(childPath);
|
|
2092
2092
|
} else {
|
|
2093
|
-
let childPath = (0, ($parcel$interopDefault($
|
|
2093
|
+
let childPath = (0, ($parcel$interopDefault($b70xC$path))).join(root, ent.name);
|
|
2094
2094
|
toDelete.push(childPath);
|
|
2095
2095
|
if (ent.isDirectory()) stack.push(childPath);
|
|
2096
2096
|
}
|
|
@@ -2107,10 +2107,10 @@ class $994c93c6792b2070$export$5963299e2424ca1c {
|
|
|
2107
2107
|
dir = this._normalizePath(dir);
|
|
2108
2108
|
await this.writable.mkdirp(dir);
|
|
2109
2109
|
if (this.deleted != null) {
|
|
2110
|
-
let root = (0, ($parcel$interopDefault($
|
|
2110
|
+
let root = (0, ($parcel$interopDefault($b70xC$path))).parse(dir).root;
|
|
2111
2111
|
while(dir !== root){
|
|
2112
2112
|
this.deleted.delete(dir);
|
|
2113
|
-
dir = (0, ($parcel$interopDefault($
|
|
2113
|
+
dir = (0, ($parcel$interopDefault($b70xC$path))).dirname(dir);
|
|
2114
2114
|
}
|
|
2115
2115
|
}
|
|
2116
2116
|
}
|
|
@@ -2196,7 +2196,7 @@ class $994c93c6792b2070$export$5963299e2424ca1c {
|
|
|
2196
2196
|
let entries = new Map();
|
|
2197
2197
|
try {
|
|
2198
2198
|
for (let entry of this.writable.readdirSync(dir, opts)){
|
|
2199
|
-
let filePath = (0, ($parcel$interopDefault($
|
|
2199
|
+
let filePath = (0, ($parcel$interopDefault($b70xC$path))).join(dir, entry.name ?? entry);
|
|
2200
2200
|
if (this.deleted.has(filePath)) continue;
|
|
2201
2201
|
entries.set(filePath, entry);
|
|
2202
2202
|
}
|
|
@@ -2205,7 +2205,7 @@ class $994c93c6792b2070$export$5963299e2424ca1c {
|
|
|
2205
2205
|
}
|
|
2206
2206
|
try {
|
|
2207
2207
|
for (let entry of this.readable.readdirSync(dir, opts)){
|
|
2208
|
-
let filePath = (0, ($parcel$interopDefault($
|
|
2208
|
+
let filePath = (0, ($parcel$interopDefault($b70xC$path))).join(dir, entry.name ?? entry);
|
|
2209
2209
|
if (this.deleted.has(filePath)) continue;
|
|
2210
2210
|
if (entries.has(filePath)) continue;
|
|
2211
2211
|
entries.set(filePath, entry);
|
|
@@ -2237,16 +2237,16 @@ class $994c93c6792b2070$export$5963299e2424ca1c {
|
|
|
2237
2237
|
await this.writable.writeSnapshot(dir, snapshot, opts);
|
|
2238
2238
|
}
|
|
2239
2239
|
findAncestorFile(fileNames, fromDir, root) {
|
|
2240
|
-
return (0, $
|
|
2240
|
+
return (0, $ac65417502ef89d5$export$d51a93c758976388)(this, fileNames, fromDir, root);
|
|
2241
2241
|
}
|
|
2242
2242
|
findNodeModule(moduleName, fromDir) {
|
|
2243
|
-
return (0, $
|
|
2243
|
+
return (0, $ac65417502ef89d5$export$4c6d088a7d7f9947)(this, moduleName, fromDir);
|
|
2244
2244
|
}
|
|
2245
2245
|
findFirstFile(filePaths) {
|
|
2246
|
-
return (0, $
|
|
2246
|
+
return (0, $ac65417502ef89d5$export$64df6e3182fd5b2d)(this, filePaths);
|
|
2247
2247
|
}
|
|
2248
2248
|
}
|
|
2249
|
-
class $
|
|
2249
|
+
class $ec29e7a1a330544d$var$FSError extends Error {
|
|
2250
2250
|
constructor(code, path, message){
|
|
2251
2251
|
super(`${code}: ${path} ${message}`);
|
|
2252
2252
|
this.name = 'FSError';
|
|
@@ -2255,24 +2255,24 @@ class $994c93c6792b2070$var$FSError extends Error {
|
|
|
2255
2255
|
Error.captureStackTrace?.(this, this.constructor);
|
|
2256
2256
|
}
|
|
2257
2257
|
}
|
|
2258
|
-
(0, $
|
|
2258
|
+
(0, $b70xC$atlaspackcore.registerSerializableClass)(`${(0, (/*@__PURE__*/$parcel$interopDefault($83f3616b46c3aeac$exports))).version}:OverlayFS`, $ec29e7a1a330544d$export$5963299e2424ca1c);
|
|
2259
2259
|
|
|
2260
2260
|
|
|
2261
|
-
const $
|
|
2262
|
-
async function $
|
|
2261
|
+
const $8eabb55e3bc645c7$var$pipeline = (0, $b70xC$util.promisify)((0, ($parcel$interopDefault($b70xC$stream))).pipeline);
|
|
2262
|
+
async function $8eabb55e3bc645c7$export$d3a8044e3fef7335(sourceFS, source, destinationFS, destination) {
|
|
2263
2263
|
await destinationFS.mkdirp(destination);
|
|
2264
2264
|
let files = await sourceFS.readdir(source);
|
|
2265
2265
|
for (let file of files){
|
|
2266
|
-
let sourcePath = (0, ($parcel$interopDefault($
|
|
2267
|
-
let destPath = (0, ($parcel$interopDefault($
|
|
2266
|
+
let sourcePath = (0, ($parcel$interopDefault($b70xC$path))).join(source, file);
|
|
2267
|
+
let destPath = (0, ($parcel$interopDefault($b70xC$path))).join(destination, file);
|
|
2268
2268
|
let stats = await sourceFS.stat(sourcePath);
|
|
2269
|
-
if (stats.isFile()) await $
|
|
2270
|
-
else if (stats.isDirectory()) await $
|
|
2269
|
+
if (stats.isFile()) await $8eabb55e3bc645c7$var$pipeline(sourceFS.createReadStream(sourcePath), destinationFS.createWriteStream(destPath));
|
|
2270
|
+
else if (stats.isDirectory()) await $8eabb55e3bc645c7$export$d3a8044e3fef7335(sourceFS, sourcePath, destinationFS, destPath);
|
|
2271
2271
|
}
|
|
2272
2272
|
}
|
|
2273
|
-
$parcel$exportWildcard(module.exports, $
|
|
2274
|
-
$parcel$exportWildcard(module.exports, $
|
|
2275
|
-
$parcel$exportWildcard(module.exports, $
|
|
2273
|
+
$parcel$exportWildcard(module.exports, $c384d5a91630ebac$exports);
|
|
2274
|
+
$parcel$exportWildcard(module.exports, $b04b349429406f05$exports);
|
|
2275
|
+
$parcel$exportWildcard(module.exports, $ec29e7a1a330544d$exports);
|
|
2276
2276
|
|
|
2277
2277
|
|
|
2278
2278
|
//# sourceMappingURL=index.js.map
|