@parcel/fs
Advanced tools
Comparing version 2.0.0-dev.1586 to 2.0.0-dev.1603
@@ -62,3 +62,3 @@ var $bYqMO$path = require("path"); | ||
var $e2cf39c7fb7e0fac$exports = {}; | ||
$e2cf39c7fb7e0fac$exports = JSON.parse('{"name":"@parcel/fs","version":"2.0.0-dev.1586+ee048fa0b","description":"Blazing fast, zero configuration web application bundler","license":"MIT","publishConfig":{"access":"public"},"funding":{"type":"opencollective","url":"https://opencollective.com/parcel"},"repository":{"type":"git","url":"https://github.com/parcel-bundler/parcel.git"},"main":"lib/index.js","source":"src/index.js","types":"index.d.ts","engines":{"node":">= 16.0.0"},"targets":{"types":false,"main":{"includeNodeModules":{"@parcel/core":false,"@parcel/rust":false,"@parcel/types-internal":false,"@parcel/utils":false,"@parcel/watcher":false,"@parcel/workers":false}},"browser":{"includeNodeModules":{"@parcel/core":false,"@parcel/rust":false,"@parcel/types-internal":false,"@parcel/utils":false,"@parcel/watcher":false,"@parcel/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":{"@parcel/rust":"2.12.1-dev.3209+ee048fa0b","@parcel/types-internal":"2.12.1-dev.3209+ee048fa0b","@parcel/utils":"2.0.0-dev.1586+ee048fa0b","@parcel/watcher":"^2.0.7","@parcel/workers":"2.0.0-dev.1586+ee048fa0b"},"devDependencies":{"graceful-fs":"^4.2.4","ncp":"^2.0.0","nullthrows":"^1.1.1","utility-types":"^3.10.0"},"peerDependencies":{"@parcel/core":"^2.0.0-dev.1584+ee048fa0b"},"browser":{"@parcel/fs":"./lib/browser.js","./src/NodeFS.js":"./src/NodeFS.browser.js"},"gitHead":"ee048fa0b95364a320c040d012673766869f4c87"}'); | ||
$e2cf39c7fb7e0fac$exports = JSON.parse("{\"name\":\"@parcel/fs\",\"version\":\"2.0.0-dev.1603+795716bf4\",\"description\":\"Blazing fast, zero configuration web application bundler\",\"license\":\"MIT\",\"publishConfig\":{\"access\":\"public\"},\"funding\":{\"type\":\"opencollective\",\"url\":\"https://opencollective.com/parcel\"},\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/parcel-bundler/parcel.git\"},\"main\":\"lib/index.js\",\"source\":\"src/index.js\",\"types\":\"index.d.ts\",\"engines\":{\"node\":\">= 16.0.0\"},\"targets\":{\"types\":false,\"main\":{\"includeNodeModules\":{\"@parcel/core\":false,\"@parcel/rust\":false,\"@parcel/types-internal\":false,\"@parcel/utils\":false,\"@parcel/watcher\":false,\"@parcel/workers\":false}},\"browser\":{\"includeNodeModules\":{\"@parcel/core\":false,\"@parcel/rust\":false,\"@parcel/types-internal\":false,\"@parcel/utils\":false,\"@parcel/watcher\":false,\"@parcel/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\":{\"@parcel/rust\":\"2.12.1-dev.3229+795716bf4\",\"@parcel/types-internal\":\"2.12.1-dev.3229+795716bf4\",\"@parcel/utils\":\"2.0.0-dev.1603+795716bf4\",\"@parcel/watcher\":\"^2.0.7\",\"@parcel/workers\":\"2.0.0-dev.1603+795716bf4\"},\"devDependencies\":{\"graceful-fs\":\"^4.2.4\",\"ncp\":\"^2.0.0\",\"nullthrows\":\"^1.1.1\",\"utility-types\":\"^3.10.0\"},\"peerDependencies\":{\"@parcel/core\":\"^2.0.0-dev.1601+795716bf4\"},\"browser\":{\"@parcel/fs\":\"./lib/browser.js\",\"./src/NodeFS.js\":\"./src/NodeFS.browser.js\"},\"gitHead\":\"795716bf4650f012262eade20f8dc1cfd1f02580\"}"); | ||
@@ -68,6 +68,6 @@ | ||
var $9740ff9b088a7fed$exports = {}; | ||
"use strict"; | ||
'use strict'; | ||
function $9740ff9b088a7fed$var$nullthrows(x, message) { | ||
if (x != null) return x; | ||
var error = new Error(message !== undefined ? message : "Got unexpected " + x); | ||
var error = new Error(message !== undefined ? message : 'Got unexpected ' + x); | ||
error.framesToPop = 1; // Skip nullthrows's own stack frame. | ||
@@ -78,3 +78,3 @@ throw error; | ||
$9740ff9b088a7fed$exports.default = $9740ff9b088a7fed$var$nullthrows; | ||
Object.defineProperty($9740ff9b088a7fed$exports, "__esModule", { | ||
Object.defineProperty($9740ff9b088a7fed$exports, '__esModule', { | ||
value: true | ||
@@ -90,5 +90,5 @@ }); | ||
// Skip node_modules directories | ||
if ((0, ($parcel$interopDefault($bYqMO$path))).basename(dir) === "node_modules") dir = (0, ($parcel$interopDefault($bYqMO$path))).dirname(dir); | ||
if ((0, ($parcel$interopDefault($bYqMO$path))).basename(dir) === 'node_modules') dir = (0, ($parcel$interopDefault($bYqMO$path))).dirname(dir); | ||
try { | ||
let moduleDir = (0, ($parcel$interopDefault($bYqMO$path))).join(dir, "node_modules", moduleName); | ||
let moduleDir = (0, ($parcel$interopDefault($bYqMO$path))).join(dir, 'node_modules', moduleName); | ||
let stats = fs.statSync(moduleDir); | ||
@@ -108,3 +108,3 @@ if (stats.isDirectory()) return moduleDir; | ||
while(true){ | ||
if ((0, ($parcel$interopDefault($bYqMO$path))).basename(dir) === "node_modules") return null; | ||
if ((0, ($parcel$interopDefault($bYqMO$path))).basename(dir) === 'node_modules') return null; | ||
for (const fileName of fileNames){ | ||
@@ -157,3 +157,3 @@ let filePath = (0, ($parcel$interopDefault($bYqMO$path))).join(dir, fileName); | ||
$cb5a76a426d1cae6$var$instances.set(this.id, this); | ||
this._emitter.on("allWorkersRegistered", ()=>{ | ||
this._emitter.on('allWorkersRegistered', ()=>{ | ||
for (let resolve of this._workerRegisterResolves)resolve(); | ||
@@ -168,3 +168,3 @@ this._workerRegisterResolves = []; | ||
(0, ($parcel$interopDefault($bYqMO$parcelworkers))).getWorkerApi().runHandle(opts.handle, [ | ||
"decrementWorkerInstance", | ||
'decrementWorkerInstance', | ||
[] | ||
@@ -198,3 +198,3 @@ ]); | ||
this._numWorkerInstances--; | ||
if (this._numWorkerInstances === this._workerHandles.length) this._emitter.emit("allWorkersRegistered"); | ||
if (this._numWorkerInstances === this._workerHandles.length) this._emitter.emit('allWorkersRegistered'); | ||
} | ||
@@ -226,5 +226,5 @@ cwd() { | ||
filePath = this._normalizePath(filePath); | ||
if (this.dirs.has(filePath)) throw new $cb5a76a426d1cae6$export$d414276624ebf134("EISDIR", filePath, "is a directory"); | ||
if (this.dirs.has(filePath)) throw new $cb5a76a426d1cae6$export$d414276624ebf134('EISDIR', filePath, 'is a directory'); | ||
let dir = (0, ($parcel$interopDefault($bYqMO$path))).dirname(filePath); | ||
if (!this.dirs.has(dir)) throw new $cb5a76a426d1cae6$export$d414276624ebf134("ENOENT", dir, "does not exist"); | ||
if (!this.dirs.has(dir)) throw new $cb5a76a426d1cae6$export$d414276624ebf134('ENOENT', dir, 'does not exist'); | ||
let buffer = $cb5a76a426d1cae6$export$df9eb3e75aa27a22(contents); | ||
@@ -238,3 +238,3 @@ let file = this.files.get(filePath); | ||
await this._sendWorkerEvent({ | ||
type: "writeFile", | ||
type: 'writeFile', | ||
path: filePath, | ||
@@ -244,3 +244,3 @@ entry: this.files.get(filePath) | ||
this._triggerEvent({ | ||
type: file ? "update" : "create", | ||
type: file ? 'update' : 'create', | ||
path: filePath | ||
@@ -256,3 +256,3 @@ }); | ||
let file = this.files.get(filePath); | ||
if (file == null) throw new $cb5a76a426d1cae6$export$d414276624ebf134("ENOENT", filePath, "does not exist"); | ||
if (file == null) throw new $cb5a76a426d1cae6$export$d414276624ebf134('ENOENT', filePath, 'does not exist'); | ||
let buffer = file.read(); | ||
@@ -271,3 +271,3 @@ if (encoding) return buffer.toString(encoding); | ||
let file = this.files.get(filePath); | ||
if (file == null) throw new $cb5a76a426d1cae6$export$d414276624ebf134("ENOENT", filePath, "does not exist"); | ||
if (file == null) throw new $cb5a76a426d1cae6$export$d414276624ebf134('ENOENT', filePath, 'does not exist'); | ||
return file.stat(); | ||
@@ -281,3 +281,3 @@ } | ||
dir = this._normalizePath(dir); | ||
if (!this.dirs.has(dir)) throw new $cb5a76a426d1cae6$export$d414276624ebf134("ENOENT", dir, "does not exist"); | ||
if (!this.dirs.has(dir)) throw new $cb5a76a426d1cae6$export$d414276624ebf134('ENOENT', dir, 'does not exist'); | ||
if (!dir.endsWith((0, ($parcel$interopDefault($bYqMO$path))).sep)) dir += (0, ($parcel$interopDefault($bYqMO$path))).sep; | ||
@@ -313,3 +313,3 @@ let res = []; | ||
filePath = this._normalizePath(filePath); | ||
if (!this.files.has(filePath) && !this.dirs.has(filePath)) throw new $cb5a76a426d1cae6$export$d414276624ebf134("ENOENT", filePath, "does not exist"); | ||
if (!this.files.has(filePath) && !this.dirs.has(filePath)) throw new $cb5a76a426d1cae6$export$d414276624ebf134('ENOENT', filePath, 'does not exist'); | ||
this.files.delete(filePath); | ||
@@ -319,7 +319,7 @@ this.dirs.delete(filePath); | ||
await this._sendWorkerEvent({ | ||
type: "unlink", | ||
type: 'unlink', | ||
path: filePath | ||
}); | ||
this._triggerEvent({ | ||
type: "delete", | ||
type: 'delete', | ||
path: filePath | ||
@@ -332,3 +332,3 @@ }); | ||
if (this.dirs.has(dir)) return Promise.resolve(); | ||
if (this.files.has(dir)) throw new $cb5a76a426d1cae6$export$d414276624ebf134("ENOENT", dir, "is not a directory"); | ||
if (this.files.has(dir)) throw new $cb5a76a426d1cae6$export$d414276624ebf134('ENOENT', dir, 'is not a directory'); | ||
let root = (0, ($parcel$interopDefault($bYqMO$path))).parse(dir).root; | ||
@@ -339,7 +339,7 @@ while(dir !== root){ | ||
await this._sendWorkerEvent({ | ||
type: "mkdir", | ||
type: 'mkdir', | ||
path: dir | ||
}); | ||
this._triggerEvent({ | ||
type: "create", | ||
type: 'create', | ||
path: dir | ||
@@ -358,7 +358,7 @@ }); | ||
await this._sendWorkerEvent({ | ||
type: "unlink", | ||
type: 'unlink', | ||
path: filePath | ||
}); | ||
this._triggerEvent({ | ||
type: "delete", | ||
type: 'delete', | ||
path: filePath | ||
@@ -371,7 +371,7 @@ }); | ||
await this._sendWorkerEvent({ | ||
type: "unlink", | ||
type: 'unlink', | ||
path: filePath | ||
}); | ||
this._triggerEvent({ | ||
type: "delete", | ||
type: 'delete', | ||
path: dirPath | ||
@@ -383,3 +383,3 @@ }); | ||
await this._sendWorkerEvent({ | ||
type: "unlink", | ||
type: 'unlink', | ||
path: filePath | ||
@@ -390,7 +390,7 @@ }); | ||
await this._sendWorkerEvent({ | ||
type: "unlink", | ||
type: 'unlink', | ||
path: filePath | ||
}); | ||
this._triggerEvent({ | ||
type: "delete", | ||
type: 'delete', | ||
path: filePath | ||
@@ -401,7 +401,7 @@ }); | ||
await this._sendWorkerEvent({ | ||
type: "unlink", | ||
type: 'unlink', | ||
path: filePath | ||
}); | ||
this._triggerEvent({ | ||
type: "delete", | ||
type: 'delete', | ||
path: filePath | ||
@@ -418,7 +418,7 @@ }); | ||
await this._sendWorkerEvent({ | ||
type: "mkdir", | ||
type: 'mkdir', | ||
path: destination | ||
}); | ||
this._triggerEvent({ | ||
type: "create", | ||
type: 'create', | ||
path: destination | ||
@@ -433,7 +433,7 @@ }); | ||
await this._sendWorkerEvent({ | ||
type: "mkdir", | ||
type: 'mkdir', | ||
path: destination | ||
}); | ||
this._triggerEvent({ | ||
type: "create", | ||
type: 'create', | ||
path: destName | ||
@@ -448,3 +448,3 @@ }); | ||
await this._sendWorkerEvent({ | ||
type: "writeFile", | ||
type: 'writeFile', | ||
path: destName, | ||
@@ -454,3 +454,3 @@ entry: file | ||
this._triggerEvent({ | ||
type: exists ? "update" : "create", | ||
type: exists ? 'update' : 'create', | ||
path: destName | ||
@@ -479,3 +479,3 @@ }); | ||
await this._sendWorkerEvent({ | ||
type: "symlink", | ||
type: 'symlink', | ||
path: path, | ||
@@ -510,3 +510,3 @@ target: target | ||
this._workerHandles.push(handle); | ||
if (this._numWorkerInstances === this._workerHandles.length) this._emitter.emit("allWorkersRegistered"); | ||
if (this._numWorkerInstances === this._workerHandles.length) this._emitter.emit('allWorkersRegistered'); | ||
} | ||
@@ -539,3 +539,3 @@ async _sendWorkerEvent(event) { | ||
async getEventsSince(dir, snapshot, opts) { | ||
let contents = await this.readFile(snapshot, "utf8"); | ||
let contents = await this.readFile(snapshot, 'utf8'); | ||
let len = Number(contents); | ||
@@ -548,3 +548,3 @@ let events = this.events.slice(len); | ||
async writeSnapshot(dir, snapshot) { | ||
await this.writeFile(snapshot, "" + this.events.length); | ||
await this.writeFile(snapshot, '' + this.events.length); | ||
} | ||
@@ -575,3 +575,3 @@ findAncestorFile(fileNames, fromDir, root) { | ||
super(`${code}: ${path} ${message}`); | ||
this.name = "FSError"; | ||
this.name = 'FSError'; | ||
this.code = code; | ||
@@ -598,3 +598,3 @@ this.path = path; | ||
}, (err)=>{ | ||
this.emit("error", err); | ||
this.emit('error', err); | ||
}); | ||
@@ -615,3 +615,3 @@ } | ||
_write(chunk, encoding, callback) { | ||
let c = typeof chunk === "string" ? $cb5a76a426d1cae6$require$Buffer.from(chunk, encoding) : chunk; | ||
let c = typeof chunk === 'string' ? $cb5a76a426d1cae6$require$Buffer.from(chunk, encoding) : chunk; | ||
this.buffer = $cb5a76a426d1cae6$require$Buffer.concat([ | ||
@@ -752,3 +752,3 @@ this.buffer, | ||
function $cb5a76a426d1cae6$export$df9eb3e75aa27a22(contents) { | ||
if (typeof contents !== "string" && contents.buffer instanceof (0, $bYqMO$parcelutils.SharedBuffer)) return contents; | ||
if (typeof contents !== 'string' && contents.buffer instanceof (0, $bYqMO$parcelutils.SharedBuffer)) return contents; | ||
let contentsBuffer = contents; | ||
@@ -762,3 +762,3 @@ // For the polyfilled buffer module, it's faster to always convert once so that the subsequent | ||
if (length > 0) { | ||
if (typeof contentsBuffer === "string") buffer.write(contentsBuffer); | ||
if (typeof contentsBuffer === 'string') buffer.write(contentsBuffer); | ||
else buffer.set(contentsBuffer); | ||
@@ -778,9 +778,9 @@ } | ||
]); | ||
this.handleFn("_registerWorker", [ | ||
this.handleFn('_registerWorker', [ | ||
(0, ($parcel$interopDefault($bYqMO$parcelworkers))).getWorkerApi().createReverseHandle((event)=>{ | ||
switch(event.type){ | ||
case "writeFile": | ||
case 'writeFile': | ||
this.files.set(event.path, event.entry); | ||
break; | ||
case "unlink": | ||
case 'unlink': | ||
this.files.delete(event.path); | ||
@@ -790,6 +790,6 @@ this.dirs.delete(event.path); | ||
break; | ||
case "mkdir": | ||
case 'mkdir': | ||
this.dirs.set(event.path, new $cb5a76a426d1cae6$var$Directory()); | ||
break; | ||
case "symlink": | ||
case 'symlink': | ||
this.symlinks.set(event.path, event.target); | ||
@@ -813,3 +813,3 @@ break; | ||
let buffer = $cb5a76a426d1cae6$export$df9eb3e75aa27a22(contents); | ||
return this.handleFn("writeFile", [ | ||
return this.handleFn('writeFile', [ | ||
filePath, | ||
@@ -822,3 +822,3 @@ buffer, | ||
super.unlink(filePath); | ||
return this.handleFn("unlink", [ | ||
return this.handleFn('unlink', [ | ||
filePath | ||
@@ -829,3 +829,3 @@ ]); | ||
super.mkdirp(dir); | ||
return this.handleFn("mkdirp", [ | ||
return this.handleFn('mkdirp', [ | ||
dir | ||
@@ -836,3 +836,3 @@ ]); | ||
super.rimraf(filePath); | ||
return this.handleFn("rimraf", [ | ||
return this.handleFn('rimraf', [ | ||
filePath | ||
@@ -843,3 +843,3 @@ ]); | ||
super.ncp(source, destination); | ||
return this.handleFn("ncp", [ | ||
return this.handleFn('ncp', [ | ||
source, | ||
@@ -851,3 +851,3 @@ destination | ||
super.symlink(target, path); | ||
return this.handleFn("symlink", [ | ||
return this.handleFn('symlink', [ | ||
target, | ||
@@ -898,3 +898,3 @@ path | ||
filePath = this._normalizePath(filePath); | ||
if (this.deleted.has(filePath)) throw new $e0e2c632a7073b51$var$FSError("ENOENT", filePath, "does not exist"); | ||
if (this.deleted.has(filePath)) throw new $e0e2c632a7073b51$var$FSError('ENOENT', filePath, 'does not exist'); | ||
return filePath; | ||
@@ -904,3 +904,3 @@ } | ||
filePath = this._deletedThrows(filePath); | ||
if (!this.existsSync(filePath)) throw new $e0e2c632a7073b51$var$FSError("ENOENT", filePath, "does not exist"); | ||
if (!this.existsSync(filePath)) throw new $e0e2c632a7073b51$var$FSError('ENOENT', filePath, 'does not exist'); | ||
return filePath; | ||
@@ -921,3 +921,3 @@ } | ||
// so we use `readdirSync` to check if the path is a symlink. | ||
let parent = (0, ($parcel$interopDefault($bYqMO$path))).resolve(filePath, ".."); | ||
let parent = (0, ($parcel$interopDefault($bYqMO$path))).resolve(filePath, '..'); | ||
if (parent === filePath) return false; | ||
@@ -928,3 +928,3 @@ try { | ||
})){ | ||
if (typeof dirent === "string") break; // {withFileTypes: true} not supported | ||
if (typeof dirent === 'string') break; // {withFileTypes: true} not supported | ||
else if (dirent.name === name) { | ||
@@ -935,3 +935,3 @@ if (dirent.isSymbolicLink()) return true; | ||
} catch (e) { | ||
if (e.code === "ENOENT") return false; | ||
if (e.code === 'ENOENT') return false; | ||
throw e; | ||
@@ -993,3 +993,3 @@ } | ||
withFileTypes: true | ||
}))if (typeof ent === "string") { | ||
}))if (typeof ent === 'string') { | ||
let childPath = (0, ($parcel$interopDefault($bYqMO$path))).join(root, ent); | ||
@@ -1008,3 +1008,3 @@ toDelete.push(childPath); | ||
} catch (e) { | ||
if (e.code === "ENOENT" && !this.readable.existsSync(filePath)) throw e; | ||
if (e.code === 'ENOENT' && !this.readable.existsSync(filePath)) throw e; | ||
} | ||
@@ -1071,3 +1071,3 @@ for (let pathToDelete of toDelete)this.deleted.add(pathToDelete); | ||
} catch (e) { | ||
if (e.code === "ENOENT" && this.existsSync(filePath)) return this.readable.statSync(filePath); | ||
if (e.code === 'ENOENT' && this.existsSync(filePath)) return this.readable.statSync(filePath); | ||
throw e; | ||
@@ -1092,3 +1092,3 @@ } | ||
} catch (err) { | ||
if (err.code !== "ENOENT") throw err; | ||
if (err.code !== 'ENOENT') throw err; | ||
} | ||
@@ -1161,3 +1161,3 @@ if (this.deleted.has(filePath)) return false; | ||
super(`${code}: ${path} ${message}`); | ||
this.name = "FSError"; | ||
this.name = 'FSError'; | ||
this.code = code; | ||
@@ -1164,0 +1164,0 @@ this.path = path; |
{ | ||
"name": "@parcel/fs", | ||
"version": "2.0.0-dev.1586+ee048fa0b", | ||
"version": "2.0.0-dev.1603+795716bf4", | ||
"description": "Blazing fast, zero configuration web application bundler", | ||
@@ -51,7 +51,7 @@ "license": "MIT", | ||
"dependencies": { | ||
"@parcel/rust": "2.12.1-dev.3209+ee048fa0b", | ||
"@parcel/types-internal": "2.12.1-dev.3209+ee048fa0b", | ||
"@parcel/utils": "2.0.0-dev.1586+ee048fa0b", | ||
"@parcel/rust": "2.12.1-dev.3229+795716bf4", | ||
"@parcel/types-internal": "2.12.1-dev.3229+795716bf4", | ||
"@parcel/utils": "2.0.0-dev.1603+795716bf4", | ||
"@parcel/watcher": "^2.0.7", | ||
"@parcel/workers": "2.0.0-dev.1586+ee048fa0b" | ||
"@parcel/workers": "2.0.0-dev.1603+795716bf4" | ||
}, | ||
@@ -65,3 +65,3 @@ "devDependencies": { | ||
"peerDependencies": { | ||
"@parcel/core": "^2.0.0-dev.1584+ee048fa0b" | ||
"@parcel/core": "^2.0.0-dev.1601+795716bf4" | ||
}, | ||
@@ -72,3 +72,3 @@ "browser": { | ||
}, | ||
"gitHead": "ee048fa0b95364a320c040d012673766869f4c87" | ||
"gitHead": "795716bf4650f012262eade20f8dc1cfd1f02580" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
418529
5113