Skip to content

Commit 832b89e

Browse files
authored
feat(plugin-essentials): make yarn remove remove package(s) from peerDependenciesMeta (#864)
* feat(plugin-essentials): make `yarn remove` remove package(s) from peerDependenciesMeta * chore(release-workflow): set releases * refactor(plugin-essentials/remove): change .get to .has
1 parent 041b7ed commit 832b89e

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

.yarn/versions/f0f68ba3.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
releases:
2+
"@yarnpkg/plugin-essentials": prerelease
3+
"@yarnpkg/cli": prerelease
4+
5+
declined:
6+
- "@yarnpkg/plugin-constraints"
7+
- "@yarnpkg/plugin-dlx"
8+
- "@yarnpkg/plugin-init"
9+
- "@yarnpkg/plugin-interactive-tools"
10+
- "@yarnpkg/plugin-node-modules"
11+
- "@yarnpkg/plugin-npm-cli"
12+
- "@yarnpkg/plugin-pack"
13+
- "@yarnpkg/plugin-patch"
14+
- "@yarnpkg/plugin-pnp"
15+
- "@yarnpkg/plugin-stage"
16+
- "@yarnpkg/plugin-typescript"
17+
- "@yarnpkg/plugin-version"
18+
- "@yarnpkg/plugin-workspace-tools"
19+
- "@yarnpkg/core"
20+
- "@yarnpkg/doctor"
21+
- "@yarnpkg/pnp"
22+
- "@yarnpkg/pnpify"

packages/plugin-essentials/sources/commands/remove.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@ export default class RemoveCommand extends BaseCommand {
6464
let isReferenced = false;
6565

6666
for (const workspace of affectedWorkspaces) {
67+
if (workspace.manifest.peerDependenciesMeta.has(ident.name)) {
68+
workspace.manifest.peerDependenciesMeta.delete(ident.name);
69+
70+
hasChanged = true;
71+
isReferenced = true;
72+
}
73+
6774
for (const target of targets) {
6875
const current = workspace.manifest[target].get(ident.identHash);
6976

0 commit comments

Comments
 (0)