Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .yarn/versions/a4a640ca.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
releases:
"@yarnpkg/core": patch
"@yarnpkg/plugin-catalog": patch

declined:
- "@yarnpkg/plugin-compat"
- "@yarnpkg/plugin-constraints"
- "@yarnpkg/plugin-dlx"
- "@yarnpkg/plugin-essentials"
- "@yarnpkg/plugin-exec"
- "@yarnpkg/plugin-file"
- "@yarnpkg/plugin-git"
- "@yarnpkg/plugin-github"
- "@yarnpkg/plugin-http"
- "@yarnpkg/plugin-init"
- "@yarnpkg/plugin-interactive-tools"
- "@yarnpkg/plugin-jsr"
- "@yarnpkg/plugin-link"
- "@yarnpkg/plugin-nm"
- "@yarnpkg/plugin-npm"
- "@yarnpkg/plugin-npm-cli"
- "@yarnpkg/plugin-pack"
- "@yarnpkg/plugin-patch"
- "@yarnpkg/plugin-pnp"
- "@yarnpkg/plugin-pnpm"
- "@yarnpkg/plugin-stage"
- "@yarnpkg/plugin-typescript"
- "@yarnpkg/plugin-version"
- "@yarnpkg/plugin-workspace-tools"
- "@yarnpkg/builder"
- "@yarnpkg/cli"
- "@yarnpkg/doctor"
- "@yarnpkg/extensions"
- "@yarnpkg/nm"
- "@yarnpkg/pnpify"
- "@yarnpkg/sdks"
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ describe(`Features`, () => {
devDependencies: {
[`no-deps`]: `catalog:`,
},
peerDependencies: {
[`no-deps`]: `catalog:`,
},
},
async ({path, run}) => {
await yarn.writeConfiguration(path, {
Expand Down Expand Up @@ -336,5 +339,28 @@ describe(`Features`, () => {
},
),
);

test(
`it should work with catalog references in peer dependencies`,
makeTemporaryEnv(
{
peerDependencies: {
[`no-deps`]: `catalog:`,
},
},
async ({path, run}) => {
await yarn.writeConfiguration(path, {
catalog: {
[`no-deps`]: `2.0.0`,
},
});

await run(`install`);

const manifest = await xfs.readJsonPromise(`${path}/package.json` as PortablePath);
expect(manifest.peerDependencies[`no-deps`]).toBe(`catalog:`);
},
),
);
});
});
2 changes: 1 addition & 1 deletion packages/yarnpkg-core/sources/Manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ export class Manifest {
continue;
}

if (typeof range !== `string` || (!range.startsWith(WorkspaceResolver.protocol) && !semverUtils.validRange(range))) {
if (typeof range !== `string` || (!range.startsWith(WorkspaceResolver.protocol) && !semverUtils.validRange(range)) && !range.startsWith(`catalog:`)) {
errors.push(new Error(`Invalid dependency range for '${name}'`));
range = `*`;
}
Expand Down
Loading