mirror of
https://github.com/pnpm/pnpm.git
synced 2026-05-06 06:55:12 -04:00
fix: requestPackage includes fetchingRawManifest
This commit is contained in:
@@ -98,16 +98,17 @@ function requestPackage (
|
||||
wantedDependency,
|
||||
})
|
||||
.then((packageResponseBody: object) => {
|
||||
const fetchingManifest = packageResponseBody['manifest'] // tslint:disable-line
|
||||
const fetchingRawManifest = !packageResponseBody['fetchingRawManifestInProgress'] // tslint:disable-line
|
||||
? undefined
|
||||
: limitedFetch(`${remotePrefix}/manifestResponse`, {
|
||||
: limitedFetch(`${remotePrefix}/rawManifestResponse`, {
|
||||
msgId,
|
||||
})
|
||||
delete packageResponseBody['fetchingRawManifestInProgress'] // tslint:disable-line
|
||||
|
||||
if (options.skipFetch) {
|
||||
return {
|
||||
body: packageResponseBody,
|
||||
fetchingManifest,
|
||||
fetchingRawManifest,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,8 +118,8 @@ function requestPackage (
|
||||
return {
|
||||
body: packageResponseBody,
|
||||
fetchingFiles,
|
||||
fetchingManifest,
|
||||
finishing: Promise.all([fetchingManifest, fetchingFiles]).then(() => undefined),
|
||||
fetchingRawManifest,
|
||||
finishing: Promise.all([fetchingRawManifest, fetchingFiles]).then(() => undefined),
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -71,6 +71,7 @@ export default function (
|
||||
const pkgResponse = await store.requestPackage(body.wantedDependency, body.options)
|
||||
if (pkgResponse['fetchingRawManifest']) { // tslint:disable-line
|
||||
rawManifestPromises[body.msgId] = pkgResponse['fetchingRawManifest'] // tslint:disable-line
|
||||
pkgResponse.body['fetchingRawManifestInProgress'] = true // tslint:disable-line
|
||||
}
|
||||
if (pkgResponse['fetchingFiles']) { // tslint:disable-line
|
||||
filesPromises[body.msgId] = pkgResponse['fetchingFiles'] // tslint:disable-line
|
||||
|
||||
@@ -63,6 +63,7 @@ test('server', async t => {
|
||||
}
|
||||
)
|
||||
|
||||
t.equal((await response['fetchingRawManifest']).name, 'is-positive', 'responded with fetchingRawManifest')
|
||||
t.equal(response.body.id, 'registry.npmjs.org/is-positive/1.0.0', 'responded with correct ID')
|
||||
|
||||
t.equal(response.body['manifest'].name, 'is-positive', 'responded with correct name in manifest')
|
||||
|
||||
Reference in New Issue
Block a user