Skip to content

Commit c2c4a3b

Browse files
authored
Fix Upgrade to Properly Update Scoped Packages (#206)
1 parent 5883214 commit c2c4a3b

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changeset/weak-icons-invent.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@manypkg/cli": patch
3+
---
4+
5+
Fix `manypkg upgrade @scope` upgrading packages like `@scope-something/a`

packages/cli/src/upgrade.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export async function upgradeDependency([name, tag = "latest"]: string[]) {
2424

2525
let packageNames = Object.keys(deps);
2626
packageNames.forEach((pkgName) => {
27-
if ((isScope && pkgName.startsWith(name)) || pkgName === name) {
27+
if ((isScope && pkgName.startsWith(`${name}/`)) || pkgName === name) {
2828
requiresUpdate = true;
2929
packagesToUpdate.add(pkgName);
3030
}
@@ -42,7 +42,7 @@ export async function upgradeDependency([name, tag = "latest"]: string[]) {
4242

4343
let packageNames = Object.keys(deps);
4444
packageNames.forEach((pkgName) => {
45-
if ((isScope && pkgName.startsWith(name)) || pkgName === name) {
45+
if ((isScope && pkgName.startsWith(`${name}/`)) || pkgName === name) {
4646
rootRequiresUpdate = true;
4747
packagesToUpdate.add(pkgName);
4848
}

0 commit comments

Comments
 (0)