forked from vercel/turborepo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: pnpm prune misses root dependency (vercel#3483)
Fixes vercel#2798 which comprised of two issues: - We eagerly checked if a version specifier was already resolved in the package list. This can lead to grabbing a version of the package that doesn't have the expected peer dependencies. This was as easy as moving this check after we have gone down the happy path. - Not copying internal dependencies of the monorepo root. We now internally add `//` to the prune scope to make sure we get any internal dependencies. For reviewers: I highly recommend reviewing the first commit in this PR initially as it unifies the pnpm lockfile implementations. I realized that my code split was unnecessary and made fixing bugs for lockfile v5 and v6 very difficult.
- Loading branch information
1 parent
b0aef82
commit 480ee44
Showing
14 changed files
with
299 additions
and
295 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Setup | ||
$ . ${TESTDIR}/../setup.sh | ||
$ . ${TESTDIR}/setup.sh $(pwd) | ||
|
||
Make sure that the internal util package is part of the prune output | ||
$ ${TURBO} prune --scope=web | ||
Generating pruned monorepo for web in .*/out (re) | ||
- Added shared | ||
- Added util | ||
- Added web |
6 changes: 6 additions & 0 deletions
6
cli/integration_tests/prune/monorepo_with_root_dep/apps/docs/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "docs", | ||
"dependencies": { | ||
"shared": "workspace:*" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
cli/integration_tests/prune/monorepo_with_root_dep/apps/web/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "web", | ||
"dependencies": { | ||
"shared": "workspace:*" | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
cli/integration_tests/prune/monorepo_with_root_dep/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"name": "monorepo", | ||
"packageManager": "[email protected]", | ||
"devDependencies": { | ||
"util": "workspace:*" | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
cli/integration_tests/prune/monorepo_with_root_dep/packages/shared/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"name": "shared" | ||
} |
3 changes: 3 additions & 0 deletions
3
cli/integration_tests/prune/monorepo_with_root_dep/packages/util/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"name": "util" | ||
} |
27 changes: 27 additions & 0 deletions
27
cli/integration_tests/prune/monorepo_with_root_dep/pnpm-lock.yaml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
cli/integration_tests/prune/monorepo_with_root_dep/pnpm-workspace.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
packages: | ||
- "apps/*" | ||
- "packages/*" |
4 changes: 4 additions & 0 deletions
4
cli/integration_tests/prune/monorepo_with_root_dep/turbo.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"$schema": "https://turbo.build/schema.json", | ||
"pipeline": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
SCRIPT_DIR=$(dirname ${BASH_SOURCE[0]}) | ||
TARGET_DIR=$1 | ||
cp -a ${SCRIPT_DIR}/monorepo_with_root_dep/. ${TARGET_DIR}/ |
Oops, something went wrong.