Skip to content

Commit

Permalink
Fix Upgrade to Properly Update Scoped Packages (#206)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdkopen authored Apr 14, 2024
1 parent 5883214 commit c2c4a3b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/weak-icons-invent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@manypkg/cli": patch
---

Fix `manypkg upgrade @scope` upgrading packages like `@scope-something/a`
4 changes: 2 additions & 2 deletions packages/cli/src/upgrade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export async function upgradeDependency([name, tag = "latest"]: string[]) {

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

let packageNames = Object.keys(deps);
packageNames.forEach((pkgName) => {
if ((isScope && pkgName.startsWith(name)) || pkgName === name) {
if ((isScope && pkgName.startsWith(`${name}/`)) || pkgName === name) {
rootRequiresUpdate = true;
packagesToUpdate.add(pkgName);
}
Expand Down

0 comments on commit c2c4a3b

Please sign in to comment.