mirror of
https://github.com/pnpm/pnpm.git
synced 2026-05-18 22:02:53 -04:00
fix: always resolve manifest promise even if the dependency does not have package.json (#6741)
close #6721
This commit is contained in:
6
.changeset/dull-moles-notice.md
Normal file
6
.changeset/dull-moles-notice.md
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
"@pnpm/core": patch
|
||||||
|
"@pnpm/cafs": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
always resolve manifest promise even if the dependency does not have package.json [#6721](https://github.com/pnpm/pnpm/issues/6721).
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
import path from 'path'
|
import path from 'path'
|
||||||
|
import fs from 'fs'
|
||||||
import { type RootLog } from '@pnpm/core-loggers'
|
import { type RootLog } from '@pnpm/core-loggers'
|
||||||
import { prepareEmpty } from '@pnpm/prepare'
|
import { prepareEmpty } from '@pnpm/prepare'
|
||||||
import {
|
import {
|
||||||
@@ -179,6 +180,14 @@ test('from a github repo the has no package.json file', async () => {
|
|||||||
expect(manifest.dependencies).toStrictEqual({
|
expect(manifest.dependencies).toStrictEqual({
|
||||||
'for-testing.no-package-json': 'github:pnpm/for-testing.no-package-json',
|
'for-testing.no-package-json': 'github:pnpm/for-testing.no-package-json',
|
||||||
})
|
})
|
||||||
|
fs.rmSync(path.join(project.dir(), 'node_modules'), {
|
||||||
|
recursive: true, force: true,
|
||||||
|
})
|
||||||
|
fs.rmSync(path.join(project.dir(), 'pnpm-lock.yaml'))
|
||||||
|
// if there is an unresolved promise, this test will hang until timeout.
|
||||||
|
// e.g. thrown: "Exceeded timeout of 240000 ms for a test.
|
||||||
|
await addDependenciesToPackage({}, ['pnpm/for-testing.no-package-json'], await testDefaults())
|
||||||
|
await project.has('for-testing.no-package-json')
|
||||||
})
|
})
|
||||||
|
|
||||||
test('from a github repo that needs to be built. isolated node linker is used', async () => {
|
test('from a github repo that needs to be built. isolated node linker is used', async () => {
|
||||||
|
|||||||
@@ -81,6 +81,9 @@ async function checkFilesIntegrity (
|
|||||||
})
|
})
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
if (manifest && !files['package.json']) {
|
||||||
|
manifest.resolve(undefined)
|
||||||
|
}
|
||||||
return allVerified
|
return allVerified
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user