mirror of
https://github.com/pnpm/pnpm.git
synced 2026-05-06 06:55:12 -04:00
fix(recursive): resolve directory deps correctly inside monorepo
ref #1253
This commit is contained in:
@@ -54,6 +54,33 @@ test('recursive install/uninstall', async (t: tape.Test) => {
|
||||
await projects['project-2'].hasNot('is-negative')
|
||||
})
|
||||
|
||||
// Created to cover the issue described in https://github.com/pnpm/pnpm/issues/1253
|
||||
test('recursive install with package that has link', async (t: tape.Test) => {
|
||||
const projects = preparePackages(t, [
|
||||
{
|
||||
name: 'project-1',
|
||||
version: '1.0.0',
|
||||
dependencies: {
|
||||
'is-positive': '1.0.0',
|
||||
'project-2': 'link:../project-2',
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'project-2',
|
||||
version: '1.0.0',
|
||||
dependencies: {
|
||||
'is-negative': '1.0.0',
|
||||
},
|
||||
},
|
||||
])
|
||||
|
||||
await execPnpm('recursive', 'install')
|
||||
|
||||
t.ok(projects['project-1'].requireModule('is-positive'))
|
||||
t.ok(projects['project-1'].requireModule('project-2/package.json'))
|
||||
t.ok(projects['project-2'].requireModule('is-negative'))
|
||||
})
|
||||
|
||||
test('recursive update', async (t: tape.Test) => {
|
||||
const projects = preparePackages(t, [
|
||||
{
|
||||
|
||||
@@ -727,7 +727,7 @@ async function installInContext (
|
||||
linkToBin: opts.bin,
|
||||
skipInstall: true,
|
||||
}
|
||||
const externalPkgs = installCtx.localPackages.map((localPackage) => localPackage.resolution.directory)
|
||||
const externalPkgs = installCtx.localPackages.map((localPackage) => path.join(opts.prefix, localPackage.resolution.directory))
|
||||
await externalLink(externalPkgs, installCtx.nodeModules, linkOpts)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user