@pnpm/cafs
Advanced tools
Comparing version 3.0.3 to 3.0.4
# @pnpm/cafs | ||
## 3.0.4 | ||
### Patch Changes | ||
- ef0ca24be: Use graceful-fs for reading files. | ||
- Updated dependencies [a2aeeef88] | ||
- @pnpm/graceful-fs@1.0.0 | ||
## 3.0.3 | ||
@@ -4,0 +12,0 @@ |
@@ -8,2 +8,3 @@ "use strict"; | ||
const path_1 = __importDefault(require("path")); | ||
const graceful_fs_1 = __importDefault(require("@pnpm/graceful-fs")); | ||
const p_limit_1 = __importDefault(require("p-limit")); | ||
@@ -33,3 +34,3 @@ const parseJson_1 = require("./parseJson"); | ||
if ((deferredManifest != null) && rootDir === currDir && file === 'package.json') { | ||
const buffer = await fs_1.promises.readFile(fullPath); | ||
const buffer = await graceful_fs_1.default.readFile(fullPath); | ||
parseJson_1.parseJsonBuffer(buffer, deferredManifest); | ||
@@ -39,6 +40,6 @@ return cafs.addBuffer(buffer, stat.mode); | ||
if (stat.size < MAX_BULK_SIZE) { | ||
const buffer = await fs_1.promises.readFile(fullPath); | ||
const buffer = await graceful_fs_1.default.readFile(fullPath); | ||
return cafs.addBuffer(buffer, stat.mode); | ||
} | ||
return cafs.addStream(fs_1.createReadStream(fullPath), stat.mode); | ||
return cafs.addStream(graceful_fs_1.default.createReadStream(fullPath), stat.mode); | ||
}); | ||
@@ -45,0 +46,0 @@ index[relativePath] = { |
@@ -8,2 +8,3 @@ "use strict"; | ||
const fs_1 = require("fs"); | ||
const graceful_fs_1 = __importDefault(require("@pnpm/graceful-fs")); | ||
const rimraf_1 = __importDefault(require("@zkochan/rimraf")); | ||
@@ -43,3 +44,3 @@ const p_limit_1 = __importDefault(require("p-limit")); | ||
if (deferredManifest != null) { | ||
parseJson_1.parseJsonBuffer(await fs_1.promises.readFile(filename), deferredManifest); | ||
parseJson_1.parseJsonBuffer(await graceful_fs_1.default.readFile(filename), deferredManifest); | ||
} | ||
@@ -53,3 +54,3 @@ // If a file was not edited, we are skipping integrity check. | ||
if (expectedFile.size > MAX_BULK_SIZE && (deferredManifest == null)) { | ||
const ok = Boolean(await ssri_1.default.checkStream(fs_1.createReadStream(filename), expectedFile.integrity)); | ||
const ok = Boolean(await ssri_1.default.checkStream(graceful_fs_1.default.createReadStream(filename), expectedFile.integrity)); | ||
if (!ok) { | ||
@@ -60,3 +61,3 @@ await rimraf_1.default(filename); | ||
} | ||
const data = await fs_1.promises.readFile(filename); | ||
const data = await graceful_fs_1.default.readFile(filename); | ||
const ok = Boolean(ssri_1.default.checkData(data, expectedFile.integrity)); | ||
@@ -63,0 +64,0 @@ if (!ok) { |
@@ -8,6 +8,7 @@ "use strict"; | ||
const path_1 = __importDefault(require("path")); | ||
const graceful_fs_1 = __importDefault(require("@pnpm/graceful-fs")); | ||
const dirs = new Set(); | ||
async function default_1(fileDest, buffer, mode) { | ||
await makeDirForFile(fileDest); | ||
await fs_1.promises.writeFile(fileDest, buffer, { mode }); | ||
await graceful_fs_1.default.writeFile(fileDest, buffer, { mode }); | ||
} | ||
@@ -14,0 +15,0 @@ exports.default = default_1; |
{ | ||
"name": "@pnpm/cafs", | ||
"version": "3.0.3", | ||
"version": "3.0.4", | ||
"description": "A content-addressable filesystem for the packages storage", | ||
@@ -11,2 +11,3 @@ "main": "lib/index.js", | ||
"@pnpm/fetcher-base": "11.0.0", | ||
"@pnpm/graceful-fs": "1.0.0", | ||
"@pnpm/store-controller-types": "11.0.2", | ||
@@ -13,0 +14,0 @@ "@zkochan/rimraf": "^2.1.1", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
40533
429
13
+ Added@pnpm/graceful-fs@1.0.0
+ Added@pnpm/graceful-fs@1.0.0(transitive)