Skip to content

Commit ef47d3b

Browse files
committed
rebase + changeset
1 parent 7553478 commit ef47d3b

File tree

6 files changed

+74
-6
lines changed

6 files changed

+74
-6
lines changed

.pnp.cjs

Lines changed: 0 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.yarn/versions/29002943.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
releases:
2+
"@yarnpkg/builder": patch
3+
"@yarnpkg/cli": patch
4+
"@yarnpkg/core": patch
5+
"@yarnpkg/doctor": patch
6+
"@yarnpkg/extensions": patch
7+
"@yarnpkg/nm": patch
8+
"@yarnpkg/plugin-compat": patch
9+
"@yarnpkg/plugin-constraints": patch
10+
"@yarnpkg/plugin-dlx": patch
11+
"@yarnpkg/plugin-essentials": patch
12+
"@yarnpkg/plugin-exec": patch
13+
"@yarnpkg/plugin-file": patch
14+
"@yarnpkg/plugin-git": patch
15+
"@yarnpkg/plugin-github": patch
16+
"@yarnpkg/plugin-http": patch
17+
"@yarnpkg/plugin-init": patch
18+
"@yarnpkg/plugin-interactive-tools": patch
19+
"@yarnpkg/plugin-jsr": patch
20+
"@yarnpkg/plugin-link": patch
21+
"@yarnpkg/plugin-nm": patch
22+
"@yarnpkg/plugin-npm": patch
23+
"@yarnpkg/plugin-npm-cli": patch
24+
"@yarnpkg/plugin-pack": patch
25+
"@yarnpkg/plugin-patch": patch
26+
"@yarnpkg/plugin-pnp": patch
27+
"@yarnpkg/plugin-pnpm": patch
28+
"@yarnpkg/plugin-stage": patch
29+
"@yarnpkg/plugin-typescript": patch
30+
"@yarnpkg/plugin-version": patch
31+
"@yarnpkg/plugin-workspace-tools": patch
32+
"@yarnpkg/pnpify": patch
33+
"@yarnpkg/sdks": patch
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = require(`./package.json`);
2+
3+
for (const key of [`dependencies`, `devDependencies`, `peerDependencies`]) {
4+
for (const dep of Object.keys(module.exports[key] || {})) {
5+
module.exports[key][dep] = require(dep);
6+
}
7+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"name": "peer-deps-implicit-types-conflict",
3+
"version": "1.0.0",
4+
"dependencies": {
5+
"@types/no-deps": "2.0.0"
6+
},
7+
"peerDependencies": {
8+
"no-deps": "1.0.0"
9+
}
10+
}

packages/acceptance-tests/pkg-tests-specs/sources/features/peerDependenciesMeta.test.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,29 @@ describe(`Features`, () => {
100100
},
101101
),
102102
);
103+
104+
test(
105+
`it should correctly resolve nested dependencies with different versions of types packages`,
106+
makeTemporaryEnv(
107+
{
108+
dependencies: {
109+
'peer-deps-implicit-types-conflict': `1.0.0`,
110+
'@types/no-deps': `1.0.0`,
111+
},
112+
},
113+
async ({path, run, source}) => {
114+
await run(`install`);
115+
116+
await expect(
117+
source(`require('@types/no-deps').version`),
118+
).resolves.toEqual(`1.0.0`);
119+
120+
await expect(
121+
source(`require(require.resolve('@types/no-deps', { paths: [require.resolve('peer-deps-implicit-types-conflict/package.json')] })).version`),
122+
).resolves.toEqual(`2.0.0`);
123+
},
124+
),
125+
);
103126
});
104127
});
105128

packages/yarnpkg-core/sources/Configuration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1971,7 +1971,7 @@ export class Configuration {
19711971
const typesIdent = structUtils.makeIdent(`types`, typesName);
19721972
const stringifiedTypesIdent = structUtils.stringifyIdent(typesIdent);
19731973

1974-
if (pkg.peerDependencies.has(typesIdent.identHash) || pkg.peerDependenciesMeta.has(stringifiedTypesIdent))
1974+
if (pkg.peerDependencies.has(typesIdent.identHash) || pkg.peerDependenciesMeta.has(stringifiedTypesIdent) || pkg.dependencies.has(typesIdent.identHash))
19751975
continue;
19761976

19771977
pkg.peerDependencies.set(typesIdent.identHash, structUtils.makeDescriptor(typesIdent, `*`));

0 commit comments

Comments
 (0)