@atlaspack/fs 2.12.1-dev.3368 → 2.12.1-dev.3401
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 +72 -72
- package/lib/browser.js.map +1 -1
- package/lib/index.js +110 -110
- package/lib/index.js.map +1 -1
- package/package.json +9 -9
package/lib/browser.js
CHANGED
|
@@ -8,11 +8,11 @@ var $eHCLO$atlaspackworkers = require("@atlaspack/workers");
|
|
|
8
8
|
var $eHCLO$events = require("events");
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
function $
|
|
11
|
+
function $parcel$interopDefault(a) {
|
|
12
12
|
return a && a.__esModule ? a.default : a;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
function $
|
|
15
|
+
function $parcel$exportWildcard(dest, source) {
|
|
16
16
|
Object.keys(source).forEach(function(key) {
|
|
17
17
|
if (key === 'default' || key === '__esModule' || Object.prototype.hasOwnProperty.call(dest, key)) {
|
|
18
18
|
return;
|
|
@@ -29,17 +29,17 @@ function $atlaspack$exportWildcard(dest, source) {
|
|
|
29
29
|
return dest;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
function $
|
|
32
|
+
function $parcel$export(e, n, v, s) {
|
|
33
33
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
$
|
|
36
|
+
$parcel$export(module.exports, "ncp", () => $416aba2172cbc610$export$d3a8044e3fef7335);
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
var $4d6ec4a7ba8784a9$exports = {};
|
|
41
41
|
|
|
42
|
-
$
|
|
42
|
+
$parcel$export($4d6ec4a7ba8784a9$exports, "NodeFS", () => $4d6ec4a7ba8784a9$export$c4e0ef2ab73c21e7);
|
|
43
43
|
// $FlowFixMe[prop-missing] handled by the throwing constructor
|
|
44
44
|
class $4d6ec4a7ba8784a9$export$c4e0ef2ab73c21e7 {
|
|
45
45
|
constructor(){
|
|
@@ -50,16 +50,16 @@ class $4d6ec4a7ba8784a9$export$c4e0ef2ab73c21e7 {
|
|
|
50
50
|
|
|
51
51
|
var $995ba0f44994569b$exports = {};
|
|
52
52
|
|
|
53
|
-
$
|
|
54
|
-
$
|
|
55
|
-
$
|
|
56
|
-
$
|
|
53
|
+
$parcel$export($995ba0f44994569b$exports, "MemoryFS", () => $995ba0f44994569b$export$3048eb7ec07c2c4e);
|
|
54
|
+
$parcel$export($995ba0f44994569b$exports, "FSError", () => $995ba0f44994569b$export$d414276624ebf134);
|
|
55
|
+
$parcel$export($995ba0f44994569b$exports, "makeShared", () => $995ba0f44994569b$export$df9eb3e75aa27a22);
|
|
56
|
+
$parcel$export($995ba0f44994569b$exports, "File", () => $995ba0f44994569b$export$b6afa8811b7e644e);
|
|
57
57
|
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
|
|
61
61
|
var $b6ff243d7d5008ac$exports = {};
|
|
62
|
-
$b6ff243d7d5008ac$exports = JSON.parse("{\"name\":\"@atlaspack/fs\",\"version\":\"2.12.1-dev.
|
|
62
|
+
$b6ff243d7d5008ac$exports = JSON.parse("{\"name\":\"@atlaspack/fs\",\"version\":\"2.12.1-dev.3401+b483af77f\",\"description\":\"Blazing fast, zero configuration web application bundler\",\"license\":\"MIT\",\"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.3401+b483af77f\",\"@atlaspack/rust\":\"2.12.1-dev.3401+b483af77f\",\"@atlaspack/types-internal\":\"2.12.1-dev.3401+b483af77f\",\"@atlaspack/utils\":\"2.12.1-dev.3401+b483af77f\",\"@atlaspack/workers\":\"2.12.1-dev.3401+b483af77f\",\"@parcel/watcher\":\"^2.0.7\"},\"devDependencies\":{\"@atlaspack/watcher-watchman-js\":\"2.12.1-dev.3401+b483af77f\",\"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.3401+b483af77f\"},\"browser\":{\"@atlaspack/fs\":\"./lib/browser.js\",\"./src/NodeFS.js\":\"./src/NodeFS.browser.js\"},\"gitHead\":\"b483af77f02d1258c8dad156e097b94f83671d8e\"}");
|
|
63
63
|
|
|
64
64
|
|
|
65
65
|
|
|
@@ -81,29 +81,29 @@ Object.defineProperty($023b8d639760db5c$exports, '__esModule', {
|
|
|
81
81
|
|
|
82
82
|
|
|
83
83
|
function $a9ed96e57e8d2cf3$export$4c6d088a7d7f9947(fs, moduleName, dir) {
|
|
84
|
-
let { root: root } = (0, ($
|
|
84
|
+
let { root: root } = (0, ($parcel$interopDefault($eHCLO$path))).parse(dir);
|
|
85
85
|
while(dir !== root){
|
|
86
86
|
// Skip node_modules directories
|
|
87
|
-
if ((0, ($
|
|
87
|
+
if ((0, ($parcel$interopDefault($eHCLO$path))).basename(dir) === 'node_modules') dir = (0, ($parcel$interopDefault($eHCLO$path))).dirname(dir);
|
|
88
88
|
try {
|
|
89
|
-
let moduleDir = (0, ($
|
|
89
|
+
let moduleDir = (0, ($parcel$interopDefault($eHCLO$path))).join(dir, 'node_modules', moduleName);
|
|
90
90
|
let stats = fs.statSync(moduleDir);
|
|
91
91
|
if (stats.isDirectory()) return moduleDir;
|
|
92
92
|
} catch (err) {
|
|
93
93
|
// ignore
|
|
94
94
|
}
|
|
95
95
|
// Move up a directory
|
|
96
|
-
dir = (0, ($
|
|
96
|
+
dir = (0, ($parcel$interopDefault($eHCLO$path))).dirname(dir);
|
|
97
97
|
}
|
|
98
98
|
return null;
|
|
99
99
|
}
|
|
100
100
|
function $a9ed96e57e8d2cf3$export$d51a93c758976388(fs, fileNames, dir, root) {
|
|
101
|
-
let { root: pathRoot } = (0, ($
|
|
101
|
+
let { root: pathRoot } = (0, ($parcel$interopDefault($eHCLO$path))).parse(dir);
|
|
102
102
|
// eslint-disable-next-line no-constant-condition
|
|
103
103
|
while(true){
|
|
104
|
-
if ((0, ($
|
|
104
|
+
if ((0, ($parcel$interopDefault($eHCLO$path))).basename(dir) === 'node_modules') return null;
|
|
105
105
|
for (const fileName of fileNames){
|
|
106
|
-
let filePath = (0, ($
|
|
106
|
+
let filePath = (0, ($parcel$interopDefault($eHCLO$path))).join(dir, fileName);
|
|
107
107
|
try {
|
|
108
108
|
if (fs.statSync(filePath).isFile()) return filePath;
|
|
109
109
|
} catch (err) {
|
|
@@ -111,7 +111,7 @@ function $a9ed96e57e8d2cf3$export$d51a93c758976388(fs, fileNames, dir, root) {
|
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
if (dir === root || dir === pathRoot) break;
|
|
114
|
-
dir = (0, ($
|
|
114
|
+
dir = (0, ($parcel$interopDefault($eHCLO$path))).dirname(dir);
|
|
115
115
|
}
|
|
116
116
|
return null;
|
|
117
117
|
}
|
|
@@ -131,10 +131,10 @@ let $995ba0f44994569b$var$id = 0;
|
|
|
131
131
|
class $995ba0f44994569b$export$3048eb7ec07c2c4e {
|
|
132
132
|
_numWorkerInstances = 0;
|
|
133
133
|
_workerRegisterResolves = [];
|
|
134
|
-
_emitter = new (0, ($
|
|
134
|
+
_emitter = new (0, ($parcel$interopDefault($eHCLO$events)))();
|
|
135
135
|
constructor(workerFarm){
|
|
136
136
|
this.farm = workerFarm;
|
|
137
|
-
this._cwd = (0, ($
|
|
137
|
+
this._cwd = (0, ($parcel$interopDefault($eHCLO$path))).resolve((0, ($parcel$interopDefault($eHCLO$path))).sep);
|
|
138
138
|
this.dirs = new Map([
|
|
139
139
|
[
|
|
140
140
|
this._cwd,
|
|
@@ -158,13 +158,13 @@ class $995ba0f44994569b$export$3048eb7ec07c2c4e {
|
|
|
158
158
|
let existing = $995ba0f44994569b$var$instances.get(opts.id);
|
|
159
159
|
if (existing != null) {
|
|
160
160
|
// Correct the count of worker instances since serialization assumes a new instance is created
|
|
161
|
-
(0, ($
|
|
161
|
+
(0, ($parcel$interopDefault($eHCLO$atlaspackworkers))).getWorkerApi().runHandle(opts.handle, [
|
|
162
162
|
'decrementWorkerInstance',
|
|
163
163
|
[]
|
|
164
164
|
]);
|
|
165
165
|
return existing;
|
|
166
166
|
}
|
|
167
|
-
let fs = new $995ba0f44994569b$var$WorkerFS(opts.id, (0, (/*@__PURE__*/$
|
|
167
|
+
let fs = new $995ba0f44994569b$var$WorkerFS(opts.id, (0, (/*@__PURE__*/$parcel$interopDefault($023b8d639760db5c$exports)))(opts.handle));
|
|
168
168
|
fs.dirs = opts.dirs;
|
|
169
169
|
fs.files = opts.files;
|
|
170
170
|
fs.symlinks = opts.symlinks;
|
|
@@ -197,15 +197,15 @@ class $995ba0f44994569b$export$3048eb7ec07c2c4e {
|
|
|
197
197
|
this._cwd = dir;
|
|
198
198
|
}
|
|
199
199
|
_normalizePath(filePath, realpath = true) {
|
|
200
|
-
filePath = (0, ($
|
|
201
|
-
if (!filePath.startsWith(this.cwd())) filePath = (0, ($
|
|
200
|
+
filePath = (0, ($parcel$interopDefault($eHCLO$path))).normalize(filePath);
|
|
201
|
+
if (!filePath.startsWith(this.cwd())) filePath = (0, ($parcel$interopDefault($eHCLO$path))).resolve(this.cwd(), filePath);
|
|
202
202
|
// get realpath by following symlinks
|
|
203
203
|
if (realpath) {
|
|
204
|
-
let { root: root, dir: dir, base: base } = (0, ($
|
|
205
|
-
let parts = dir.slice(root.length).split((0, ($
|
|
204
|
+
let { root: root, dir: dir, base: base } = (0, ($parcel$interopDefault($eHCLO$path))).parse(filePath);
|
|
205
|
+
let parts = dir.slice(root.length).split((0, ($parcel$interopDefault($eHCLO$path))).sep).concat(base);
|
|
206
206
|
let res = root;
|
|
207
207
|
for (let part of parts){
|
|
208
|
-
res = (0, ($
|
|
208
|
+
res = (0, ($parcel$interopDefault($eHCLO$path))).join(res, part);
|
|
209
209
|
let symlink = this.symlinks.get(res);
|
|
210
210
|
if (symlink) res = symlink;
|
|
211
211
|
}
|
|
@@ -216,7 +216,7 @@ class $995ba0f44994569b$export$3048eb7ec07c2c4e {
|
|
|
216
216
|
async writeFile(filePath, contents, options) {
|
|
217
217
|
filePath = this._normalizePath(filePath);
|
|
218
218
|
if (this.dirs.has(filePath)) throw new $995ba0f44994569b$export$d414276624ebf134('EISDIR', filePath, 'is a directory');
|
|
219
|
-
let dir = (0, ($
|
|
219
|
+
let dir = (0, ($parcel$interopDefault($eHCLO$path))).dirname(filePath);
|
|
220
220
|
if (!this.dirs.has(dir)) throw new $995ba0f44994569b$export$d414276624ebf134('ENOENT', dir, 'does not exist');
|
|
221
221
|
let buffer = $995ba0f44994569b$export$df9eb3e75aa27a22(contents);
|
|
222
222
|
let file = this.files.get(filePath);
|
|
@@ -266,22 +266,22 @@ class $995ba0f44994569b$export$3048eb7ec07c2c4e {
|
|
|
266
266
|
readdirSync(dir, opts) {
|
|
267
267
|
dir = this._normalizePath(dir);
|
|
268
268
|
if (!this.dirs.has(dir)) throw new $995ba0f44994569b$export$d414276624ebf134('ENOENT', dir, 'does not exist');
|
|
269
|
-
if (!dir.endsWith((0, ($
|
|
269
|
+
if (!dir.endsWith((0, ($parcel$interopDefault($eHCLO$path))).sep)) dir += (0, ($parcel$interopDefault($eHCLO$path))).sep;
|
|
270
270
|
let res = [];
|
|
271
271
|
for (let [filePath, entry] of this.dirs){
|
|
272
272
|
if (filePath === dir) continue;
|
|
273
|
-
if (filePath.startsWith(dir) && filePath.indexOf((0, ($
|
|
273
|
+
if (filePath.startsWith(dir) && filePath.indexOf((0, ($parcel$interopDefault($eHCLO$path))).sep, dir.length) === -1) {
|
|
274
274
|
let name = filePath.slice(dir.length);
|
|
275
275
|
if (opts?.withFileTypes) res.push(new $995ba0f44994569b$var$Dirent(name, entry));
|
|
276
276
|
else res.push(name);
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
|
-
for (let [filePath, entry] of this.files)if (filePath.startsWith(dir) && filePath.indexOf((0, ($
|
|
279
|
+
for (let [filePath, entry] of this.files)if (filePath.startsWith(dir) && filePath.indexOf((0, ($parcel$interopDefault($eHCLO$path))).sep, dir.length) === -1) {
|
|
280
280
|
let name = filePath.slice(dir.length);
|
|
281
281
|
if (opts?.withFileTypes) res.push(new $995ba0f44994569b$var$Dirent(name, entry));
|
|
282
282
|
else res.push(name);
|
|
283
283
|
}
|
|
284
|
-
for (let [from] of this.symlinks)if (from.startsWith(dir) && from.indexOf((0, ($
|
|
284
|
+
for (let [from] of this.symlinks)if (from.startsWith(dir) && from.indexOf((0, ($parcel$interopDefault($eHCLO$path))).sep, dir.length) === -1) {
|
|
285
285
|
let name = from.slice(dir.length);
|
|
286
286
|
if (opts?.withFileTypes) res.push(new $995ba0f44994569b$var$Dirent(name, {
|
|
287
287
|
mode: $995ba0f44994569b$var$S_IFLNK
|
|
@@ -314,7 +314,7 @@ class $995ba0f44994569b$export$3048eb7ec07c2c4e {
|
|
|
314
314
|
dir = this._normalizePath(dir);
|
|
315
315
|
if (this.dirs.has(dir)) return Promise.resolve();
|
|
316
316
|
if (this.files.has(dir)) throw new $995ba0f44994569b$export$d414276624ebf134('ENOENT', dir, 'is not a directory');
|
|
317
|
-
let root = (0, ($
|
|
317
|
+
let root = (0, ($parcel$interopDefault($eHCLO$path))).parse(dir).root;
|
|
318
318
|
while(dir !== root){
|
|
319
319
|
if (this.dirs.has(dir)) break;
|
|
320
320
|
this.dirs.set(dir, new $995ba0f44994569b$var$Directory());
|
|
@@ -326,14 +326,14 @@ class $995ba0f44994569b$export$3048eb7ec07c2c4e {
|
|
|
326
326
|
type: 'create',
|
|
327
327
|
path: dir
|
|
328
328
|
});
|
|
329
|
-
dir = (0, ($
|
|
329
|
+
dir = (0, ($parcel$interopDefault($eHCLO$path))).dirname(dir);
|
|
330
330
|
}
|
|
331
331
|
return Promise.resolve();
|
|
332
332
|
}
|
|
333
333
|
async rimraf(filePath) {
|
|
334
334
|
filePath = this._normalizePath(filePath);
|
|
335
335
|
if (this.dirs.has(filePath)) {
|
|
336
|
-
let dir = filePath + (0, ($
|
|
336
|
+
let dir = filePath + (0, ($parcel$interopDefault($eHCLO$path))).sep;
|
|
337
337
|
for (let filePath of this.files.keys())if (filePath.startsWith(dir)) {
|
|
338
338
|
this.files.delete(filePath);
|
|
339
339
|
await this._sendWorkerEvent({
|
|
@@ -400,9 +400,9 @@ class $995ba0f44994569b$export$3048eb7ec07c2c4e {
|
|
|
400
400
|
path: destination
|
|
401
401
|
});
|
|
402
402
|
}
|
|
403
|
-
let dir = source + (0, ($
|
|
403
|
+
let dir = source + (0, ($parcel$interopDefault($eHCLO$path))).sep;
|
|
404
404
|
for (let dirPath of this.dirs.keys())if (dirPath.startsWith(dir)) {
|
|
405
|
-
let destName = (0, ($
|
|
405
|
+
let destName = (0, ($parcel$interopDefault($eHCLO$path))).join(destination, dirPath.slice(dir.length));
|
|
406
406
|
if (!this.dirs.has(destName)) {
|
|
407
407
|
this.dirs.set(destName, new $995ba0f44994569b$var$Directory());
|
|
408
408
|
await this._sendWorkerEvent({
|
|
@@ -416,7 +416,7 @@ class $995ba0f44994569b$export$3048eb7ec07c2c4e {
|
|
|
416
416
|
}
|
|
417
417
|
}
|
|
418
418
|
for (let [filePath, file] of this.files)if (filePath.startsWith(dir)) {
|
|
419
|
-
let destName = (0, ($
|
|
419
|
+
let destName = (0, ($parcel$interopDefault($eHCLO$path))).join(destination, filePath.slice(dir.length));
|
|
420
420
|
let exists = this.files.has(destName);
|
|
421
421
|
this.files.set(destName, file);
|
|
422
422
|
await this._sendWorkerEvent({
|
|
@@ -472,7 +472,7 @@ class $995ba0f44994569b$export$3048eb7ec07c2c4e {
|
|
|
472
472
|
let events = this._eventQueue;
|
|
473
473
|
this._eventQueue = [];
|
|
474
474
|
for (let [dir, watchers] of this.watchers){
|
|
475
|
-
if (!dir.endsWith((0, ($
|
|
475
|
+
if (!dir.endsWith((0, ($parcel$interopDefault($eHCLO$path))).sep)) dir += (0, ($parcel$interopDefault($eHCLO$path))).sep;
|
|
476
476
|
if (event.path.startsWith(dir)) for (let watcher of watchers)watcher.trigger(events);
|
|
477
477
|
}
|
|
478
478
|
}, 50);
|
|
@@ -499,7 +499,7 @@ class $995ba0f44994569b$export$3048eb7ec07c2c4e {
|
|
|
499
499
|
watchers.add(watcher);
|
|
500
500
|
return Promise.resolve({
|
|
501
501
|
unsubscribe: ()=>{
|
|
502
|
-
watchers = (0, (/*@__PURE__*/$
|
|
502
|
+
watchers = (0, (/*@__PURE__*/$parcel$interopDefault($023b8d639760db5c$exports)))(watchers);
|
|
503
503
|
watchers.delete(watcher);
|
|
504
504
|
if (watchers.size === 0) this.watchers.delete(dir);
|
|
505
505
|
return Promise.resolve();
|
|
@@ -511,7 +511,7 @@ class $995ba0f44994569b$export$3048eb7ec07c2c4e {
|
|
|
511
511
|
let len = Number(contents);
|
|
512
512
|
let events = this.events.slice(len);
|
|
513
513
|
let ignore = opts.ignore;
|
|
514
|
-
if (ignore) events = events.filter((event)=>!ignore.some((i)=>event.path.startsWith(i + (0, ($
|
|
514
|
+
if (ignore) events = events.filter((event)=>!ignore.some((i)=>event.path.startsWith(i + (0, ($parcel$interopDefault($eHCLO$path))).sep)));
|
|
515
515
|
return events;
|
|
516
516
|
}
|
|
517
517
|
async writeSnapshot(dir, snapshot) {
|
|
@@ -534,7 +534,7 @@ class $995ba0f44994569b$var$Watcher {
|
|
|
534
534
|
}
|
|
535
535
|
trigger(events) {
|
|
536
536
|
let ignore = this.options.ignore;
|
|
537
|
-
if (ignore) events = events.filter((event)=>!ignore.some((i)=>event.path.startsWith(i + (0, ($
|
|
537
|
+
if (ignore) events = events.filter((event)=>!ignore.some((i)=>event.path.startsWith(i + (0, ($parcel$interopDefault($eHCLO$path))).sep)));
|
|
538
538
|
if (events.length > 0) this.fn(null, events);
|
|
539
539
|
}
|
|
540
540
|
}
|
|
@@ -735,12 +735,12 @@ class $995ba0f44994569b$var$WorkerFS extends $995ba0f44994569b$export$3048eb7ec0
|
|
|
735
735
|
// $FlowFixMe
|
|
736
736
|
super();
|
|
737
737
|
this.id = id;
|
|
738
|
-
this.handleFn = (methodName, args)=>(0, ($
|
|
738
|
+
this.handleFn = (methodName, args)=>(0, ($parcel$interopDefault($eHCLO$atlaspackworkers))).getWorkerApi().runHandle(handle, [
|
|
739
739
|
methodName,
|
|
740
740
|
args
|
|
741
741
|
]);
|
|
742
742
|
this.handleFn('_registerWorker', [
|
|
743
|
-
(0, ($
|
|
743
|
+
(0, ($parcel$interopDefault($eHCLO$atlaspackworkers))).getWorkerApi().createReverseHandle((event)=>{
|
|
744
744
|
switch(event.type){
|
|
745
745
|
case 'writeFile':
|
|
746
746
|
this.files.set(event.path, event.entry);
|
|
@@ -761,7 +761,7 @@ class $995ba0f44994569b$var$WorkerFS extends $995ba0f44994569b$export$3048eb7ec0
|
|
|
761
761
|
]);
|
|
762
762
|
}
|
|
763
763
|
static deserialize(opts) {
|
|
764
|
-
return (0, (/*@__PURE__*/$
|
|
764
|
+
return (0, (/*@__PURE__*/$parcel$interopDefault($023b8d639760db5c$exports)))($995ba0f44994569b$var$instances.get(opts.id));
|
|
765
765
|
}
|
|
766
766
|
serialize() {
|
|
767
767
|
// $FlowFixMe
|
|
@@ -811,16 +811,16 @@ class $995ba0f44994569b$var$WorkerFS extends $995ba0f44994569b$export$3048eb7ec0
|
|
|
811
811
|
]);
|
|
812
812
|
}
|
|
813
813
|
}
|
|
814
|
-
(0, $eHCLO$atlaspackcore.registerSerializableClass)(`${(0, (/*@__PURE__*/$
|
|
815
|
-
(0, $eHCLO$atlaspackcore.registerSerializableClass)(`${(0, (/*@__PURE__*/$
|
|
816
|
-
(0, $eHCLO$atlaspackcore.registerSerializableClass)(`${(0, (/*@__PURE__*/$
|
|
817
|
-
(0, $eHCLO$atlaspackcore.registerSerializableClass)(`${(0, (/*@__PURE__*/$
|
|
818
|
-
(0, $eHCLO$atlaspackcore.registerSerializableClass)(`${(0, (/*@__PURE__*/$
|
|
814
|
+
(0, $eHCLO$atlaspackcore.registerSerializableClass)(`${(0, (/*@__PURE__*/$parcel$interopDefault($b6ff243d7d5008ac$exports))).version}:MemoryFS`, $995ba0f44994569b$export$3048eb7ec07c2c4e);
|
|
815
|
+
(0, $eHCLO$atlaspackcore.registerSerializableClass)(`${(0, (/*@__PURE__*/$parcel$interopDefault($b6ff243d7d5008ac$exports))).version}:WorkerFS`, $995ba0f44994569b$var$WorkerFS);
|
|
816
|
+
(0, $eHCLO$atlaspackcore.registerSerializableClass)(`${(0, (/*@__PURE__*/$parcel$interopDefault($b6ff243d7d5008ac$exports))).version}:Stat`, $995ba0f44994569b$var$Stat);
|
|
817
|
+
(0, $eHCLO$atlaspackcore.registerSerializableClass)(`${(0, (/*@__PURE__*/$parcel$interopDefault($b6ff243d7d5008ac$exports))).version}:File`, $995ba0f44994569b$export$b6afa8811b7e644e);
|
|
818
|
+
(0, $eHCLO$atlaspackcore.registerSerializableClass)(`${(0, (/*@__PURE__*/$parcel$interopDefault($b6ff243d7d5008ac$exports))).version}:Directory`, $995ba0f44994569b$var$Directory);
|
|
819
819
|
|
|
820
820
|
|
|
821
821
|
var $49e8d7e24153085c$exports = {};
|
|
822
822
|
|
|
823
|
-
$
|
|
823
|
+
$parcel$export($49e8d7e24153085c$exports, "OverlayFS", () => $49e8d7e24153085c$export$5963299e2424ca1c);
|
|
824
824
|
|
|
825
825
|
|
|
826
826
|
|
|
@@ -831,7 +831,7 @@ $atlaspack$export($49e8d7e24153085c$exports, "OverlayFS", () => $49e8d7e24153085
|
|
|
831
831
|
class $49e8d7e24153085c$export$5963299e2424ca1c {
|
|
832
832
|
deleted = new Set();
|
|
833
833
|
constructor(workerFarmOrFS, readable){
|
|
834
|
-
if (workerFarmOrFS instanceof (0, ($
|
|
834
|
+
if (workerFarmOrFS instanceof (0, ($parcel$interopDefault($eHCLO$atlaspackworkers)))) this.writable = new (0, $995ba0f44994569b$export$3048eb7ec07c2c4e)(workerFarmOrFS);
|
|
835
835
|
else this.writable = workerFarmOrFS;
|
|
836
836
|
this.readable = readable;
|
|
837
837
|
this._cwd = readable.cwd();
|
|
@@ -862,17 +862,17 @@ class $49e8d7e24153085c$export$5963299e2424ca1c {
|
|
|
862
862
|
_isSymlink(filePath) {
|
|
863
863
|
filePath = this._normalizePath(filePath);
|
|
864
864
|
// Check the parts of the path to see if any are symlinks.
|
|
865
|
-
let { root: root, dir: dir, base: base } = (0, ($
|
|
866
|
-
let segments = dir.slice(root.length).split((0, ($
|
|
865
|
+
let { root: root, dir: dir, base: base } = (0, ($parcel$interopDefault($eHCLO$path))).parse(filePath);
|
|
866
|
+
let segments = dir.slice(root.length).split((0, ($parcel$interopDefault($eHCLO$path))).sep).concat(base);
|
|
867
867
|
while(segments.length){
|
|
868
|
-
filePath = (0, ($
|
|
868
|
+
filePath = (0, ($parcel$interopDefault($eHCLO$path))).join(root, ...segments);
|
|
869
869
|
let name = segments.pop();
|
|
870
870
|
if (this.deleted.has(filePath)) return false;
|
|
871
871
|
else if (this.writable instanceof (0, $995ba0f44994569b$export$3048eb7ec07c2c4e) && this.writable.symlinks.has(filePath)) return true;
|
|
872
872
|
else {
|
|
873
873
|
// HACK: Atlaspack fs does not provide `lstatSync`,
|
|
874
874
|
// so we use `readdirSync` to check if the path is a symlink.
|
|
875
|
-
let parent = (0, ($
|
|
875
|
+
let parent = (0, ($parcel$interopDefault($eHCLO$path))).resolve(filePath, '..');
|
|
876
876
|
if (parent === filePath) return false;
|
|
877
877
|
try {
|
|
878
878
|
for (let dirent of this.readdirSync(parent, {
|
|
@@ -893,12 +893,12 @@ class $49e8d7e24153085c$export$5963299e2424ca1c {
|
|
|
893
893
|
}
|
|
894
894
|
async _copyPathForWrite(filePath) {
|
|
895
895
|
filePath = await this._normalizePath(filePath);
|
|
896
|
-
let dirPath = (0, ($
|
|
896
|
+
let dirPath = (0, ($parcel$interopDefault($eHCLO$path))).dirname(filePath);
|
|
897
897
|
if (this.existsSync(dirPath) && !this.writable.existsSync(dirPath)) await this.writable.mkdirp(dirPath);
|
|
898
898
|
return filePath;
|
|
899
899
|
}
|
|
900
900
|
_normalizePath(filePath) {
|
|
901
|
-
return (0, ($
|
|
901
|
+
return (0, ($parcel$interopDefault($eHCLO$path))).resolve(this.cwd(), filePath);
|
|
902
902
|
}
|
|
903
903
|
// eslint-disable-next-line require-await
|
|
904
904
|
async readFile(filePath, encoding) {
|
|
@@ -938,15 +938,15 @@ class $49e8d7e24153085c$export$5963299e2424ca1c {
|
|
|
938
938
|
];
|
|
939
939
|
// Recursively add every descendant path to deleted.
|
|
940
940
|
while(stack.length){
|
|
941
|
-
let root = (0, (/*@__PURE__*/$
|
|
941
|
+
let root = (0, (/*@__PURE__*/$parcel$interopDefault($023b8d639760db5c$exports)))(stack.pop());
|
|
942
942
|
for (let ent of this.readdirSync(root, {
|
|
943
943
|
withFileTypes: true
|
|
944
944
|
}))if (typeof ent === 'string') {
|
|
945
|
-
let childPath = (0, ($
|
|
945
|
+
let childPath = (0, ($parcel$interopDefault($eHCLO$path))).join(root, ent);
|
|
946
946
|
toDelete.push(childPath);
|
|
947
947
|
if (this.statSync(childPath).isDirectory()) stack.push(childPath);
|
|
948
948
|
} else {
|
|
949
|
-
let childPath = (0, ($
|
|
949
|
+
let childPath = (0, ($parcel$interopDefault($eHCLO$path))).join(root, ent.name);
|
|
950
950
|
toDelete.push(childPath);
|
|
951
951
|
if (ent.isDirectory()) stack.push(childPath);
|
|
952
952
|
}
|
|
@@ -963,10 +963,10 @@ class $49e8d7e24153085c$export$5963299e2424ca1c {
|
|
|
963
963
|
dir = this._normalizePath(dir);
|
|
964
964
|
await this.writable.mkdirp(dir);
|
|
965
965
|
if (this.deleted != null) {
|
|
966
|
-
let root = (0, ($
|
|
966
|
+
let root = (0, ($parcel$interopDefault($eHCLO$path))).parse(dir).root;
|
|
967
967
|
while(dir !== root){
|
|
968
968
|
this.deleted.delete(dir);
|
|
969
|
-
dir = (0, ($
|
|
969
|
+
dir = (0, ($parcel$interopDefault($eHCLO$path))).dirname(dir);
|
|
970
970
|
}
|
|
971
971
|
}
|
|
972
972
|
}
|
|
@@ -1052,7 +1052,7 @@ class $49e8d7e24153085c$export$5963299e2424ca1c {
|
|
|
1052
1052
|
let entries = new Map();
|
|
1053
1053
|
try {
|
|
1054
1054
|
for (let entry of this.writable.readdirSync(dir, opts)){
|
|
1055
|
-
let filePath = (0, ($
|
|
1055
|
+
let filePath = (0, ($parcel$interopDefault($eHCLO$path))).join(dir, entry.name ?? entry);
|
|
1056
1056
|
if (this.deleted.has(filePath)) continue;
|
|
1057
1057
|
entries.set(filePath, entry);
|
|
1058
1058
|
}
|
|
@@ -1061,7 +1061,7 @@ class $49e8d7e24153085c$export$5963299e2424ca1c {
|
|
|
1061
1061
|
}
|
|
1062
1062
|
try {
|
|
1063
1063
|
for (let entry of this.readable.readdirSync(dir, opts)){
|
|
1064
|
-
let filePath = (0, ($
|
|
1064
|
+
let filePath = (0, ($parcel$interopDefault($eHCLO$path))).join(dir, entry.name ?? entry);
|
|
1065
1065
|
if (this.deleted.has(filePath)) continue;
|
|
1066
1066
|
if (entries.has(filePath)) continue;
|
|
1067
1067
|
entries.set(filePath, entry);
|
|
@@ -1111,24 +1111,24 @@ class $49e8d7e24153085c$var$FSError extends Error {
|
|
|
1111
1111
|
Error.captureStackTrace?.(this, this.constructor);
|
|
1112
1112
|
}
|
|
1113
1113
|
}
|
|
1114
|
-
(0, $eHCLO$atlaspackcore.registerSerializableClass)(`${(0, (/*@__PURE__*/$
|
|
1114
|
+
(0, $eHCLO$atlaspackcore.registerSerializableClass)(`${(0, (/*@__PURE__*/$parcel$interopDefault($b6ff243d7d5008ac$exports))).version}:OverlayFS`, $49e8d7e24153085c$export$5963299e2424ca1c);
|
|
1115
1115
|
|
|
1116
1116
|
|
|
1117
|
-
const $416aba2172cbc610$var$pipeline = (0, $eHCLO$util.promisify)((0, ($
|
|
1117
|
+
const $416aba2172cbc610$var$pipeline = (0, $eHCLO$util.promisify)((0, ($parcel$interopDefault($eHCLO$stream))).pipeline);
|
|
1118
1118
|
async function $416aba2172cbc610$export$d3a8044e3fef7335(sourceFS, source, destinationFS, destination) {
|
|
1119
1119
|
await destinationFS.mkdirp(destination);
|
|
1120
1120
|
let files = await sourceFS.readdir(source);
|
|
1121
1121
|
for (let file of files){
|
|
1122
|
-
let sourcePath = (0, ($
|
|
1123
|
-
let destPath = (0, ($
|
|
1122
|
+
let sourcePath = (0, ($parcel$interopDefault($eHCLO$path))).join(source, file);
|
|
1123
|
+
let destPath = (0, ($parcel$interopDefault($eHCLO$path))).join(destination, file);
|
|
1124
1124
|
let stats = await sourceFS.stat(sourcePath);
|
|
1125
1125
|
if (stats.isFile()) await $416aba2172cbc610$var$pipeline(sourceFS.createReadStream(sourcePath), destinationFS.createWriteStream(destPath));
|
|
1126
1126
|
else if (stats.isDirectory()) await $416aba2172cbc610$export$d3a8044e3fef7335(sourceFS, sourcePath, destinationFS, destPath);
|
|
1127
1127
|
}
|
|
1128
1128
|
}
|
|
1129
|
-
$
|
|
1130
|
-
$
|
|
1131
|
-
$
|
|
1129
|
+
$parcel$exportWildcard(module.exports, $4d6ec4a7ba8784a9$exports);
|
|
1130
|
+
$parcel$exportWildcard(module.exports, $995ba0f44994569b$exports);
|
|
1131
|
+
$parcel$exportWildcard(module.exports, $49e8d7e24153085c$exports);
|
|
1132
1132
|
|
|
1133
1133
|
|
|
1134
1134
|
//# sourceMappingURL=browser.js.map
|