@pnpm/worker
Advanced tools
Comparing version 0.3.14 to 0.3.15
@@ -55,3 +55,3 @@ "use strict"; | ||
if (status === 'error') { | ||
reject(new error_1.PnpmError('GIT_FETCH_FAILED', error)); | ||
reject(new error_1.PnpmError(error.code ?? 'GIT_FETCH_FAILED', error.message)); | ||
return; | ||
@@ -107,3 +107,3 @@ } | ||
} | ||
reject(new error_1.PnpmError('TARBALL_EXTRACT', `Failed to unpack the tarball from "${opts.url}": ${error}`)); | ||
reject(new error_1.PnpmError(error.code ?? 'TARBALL_EXTRACT', `Failed to add tarball from "${opts.url}" to store: ${error.message}`)); | ||
return; | ||
@@ -134,3 +134,3 @@ } | ||
if (status === 'error') { | ||
reject(new error_1.PnpmError('READ_FROM_STORE', error)); | ||
reject(new error_1.PnpmError(error.code ?? 'READ_FROM_STORE', error.message)); | ||
return; | ||
@@ -159,3 +159,3 @@ } | ||
if (status === 'error') { | ||
reject(new error_1.PnpmError('LINKING_FAILED', error)); | ||
reject(new error_1.PnpmError(error.code ?? 'LINKING_FAILED', error.message)); | ||
return; | ||
@@ -181,3 +181,3 @@ } | ||
if (status === 'error') { | ||
reject(new error_1.PnpmError('SYMLINK_FAILED', error)); | ||
reject(new error_1.PnpmError(error.code ?? 'SYMLINK_FAILED', error.message)); | ||
return; | ||
@@ -203,3 +203,3 @@ } | ||
if (status === 'error') { | ||
reject(new error_1.PnpmError('HARDLINK_FAILED', error)); | ||
reject(new error_1.PnpmError(error.code ?? 'HARDLINK_FAILED', error.message)); | ||
return; | ||
@@ -206,0 +206,0 @@ } |
@@ -114,3 +114,9 @@ "use strict"; | ||
catch (e) { // eslint-disable-line | ||
worker_threads_1.parentPort.postMessage({ status: 'error', error: e.toString() }); | ||
worker_threads_1.parentPort.postMessage({ | ||
status: 'error', | ||
error: { | ||
code: e.code, | ||
message: e.message ?? e.toString(), | ||
}, | ||
}); | ||
} | ||
@@ -140,5 +146,5 @@ } | ||
const cafs = cafsCache.get(cafsDir); | ||
const { filesIndex, manifest } = cafs.addFilesFromTarball(buffer, readManifest); | ||
const { filesIndex, manifest } = cafs.addFilesFromTarball(buffer, Boolean(readManifest) || !pkg?.name || !pkg.version); | ||
const { filesIntegrity, filesMap } = processFilesIndex(filesIndex); | ||
writeFilesIndexFile(filesIndexFile, { pkg: pkg ?? {}, files: filesIntegrity }); | ||
writeFilesIndexFile(filesIndexFile, { pkg: pkg ?? manifest ?? {}, files: filesIntegrity }); | ||
return { status: 'success', value: { filesIndex: filesMap, manifest } }; | ||
@@ -151,3 +157,3 @@ } | ||
const cafs = cafsCache.get(cafsDir); | ||
const { filesIndex, manifest } = cafs.addFilesFromDir(dir, readManifest); | ||
const { filesIndex, manifest } = cafs.addFilesFromDir(dir, Boolean(readManifest) || !pkg?.name || !pkg.version); | ||
const { filesIntegrity, filesMap } = processFilesIndex(filesIndex); | ||
@@ -160,3 +166,4 @@ if (sideEffectsCacheKey) { | ||
catch { | ||
filesIndex = { files: filesIntegrity }; | ||
pkg = pkg ?? manifest; | ||
filesIndex = { name: pkg?.name, version: pkg?.version, files: filesIntegrity }; | ||
} | ||
@@ -168,3 +175,3 @@ filesIndex.sideEffects = filesIndex.sideEffects ?? {}; | ||
else { | ||
writeFilesIndexFile(filesIndexFile, { pkg: pkg ?? {}, files: filesIntegrity }); | ||
writeFilesIndexFile(filesIndexFile, { pkg: pkg ?? manifest ?? {}, files: filesIntegrity }); | ||
} | ||
@@ -171,0 +178,0 @@ return { status: 'success', value: { filesIndex: filesMap, manifest } }; |
{ | ||
"name": "@pnpm/worker", | ||
"version": "0.3.14", | ||
"version": "0.3.15", | ||
"description": "A worker for extracting package taralls to the store", | ||
@@ -32,7 +32,7 @@ "main": "lib/index.js", | ||
"@pnpm/cafs-types": "4.0.0", | ||
"@pnpm/create-cafs-store": "6.0.13", | ||
"@pnpm/error": "5.0.3", | ||
"@pnpm/create-cafs-store": "6.0.14", | ||
"@pnpm/graceful-fs": "3.2.0", | ||
"@pnpm/fs.hard-link-dir": "3.0.0", | ||
"@pnpm/error": "5.0.2", | ||
"@pnpm/graceful-fs": "3.2.0", | ||
"@pnpm/store.cafs": "2.0.12", | ||
"@pnpm/store.cafs": "2.0.13", | ||
"@pnpm/symlink-dependency": "7.1.4" | ||
@@ -42,3 +42,3 @@ }, | ||
"@pnpm/types": "9.4.2", | ||
"@pnpm/worker": "0.3.14" | ||
"@pnpm/worker": "0.3.15" | ||
}, | ||
@@ -45,0 +45,0 @@ "funding": "https://opencollective.com/pnpm", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
37796
549
+ Added@pnpm/create-cafs-store@6.0.14(transitive)
+ Added@pnpm/error@5.0.3(transitive)
+ Added@pnpm/store.cafs@2.0.13(transitive)
- Removed@pnpm/create-cafs-store@6.0.13(transitive)
- Removed@pnpm/error@5.0.2(transitive)
- Removed@pnpm/store.cafs@2.0.12(transitive)
Updated@pnpm/error@5.0.3
Updated@pnpm/store.cafs@2.0.13