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.
feat(place patches in json folder when pruning for docker) (vercel#4318)
### Description Implements vercel#4289 Using the `--docker` flag with prune produces a `full` and `json` directory where the `json` directory only includes everything required to install dependencies. If a dependency is patched it makes sense to include the patch in the `json` directory as both the `package.json` and the lockfile reference the patch file. ### Testing Instructions Added an integration test to verify that patches end up in the `json` output folder.
- Loading branch information
1 parent
0d20a5e
commit 89a9e7f
Showing
6 changed files
with
61 additions
and
0 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,22 @@ | ||
Setup | ||
$ . ${TESTDIR}/../setup.sh | ||
$ . ${TESTDIR}/setup.sh $(pwd) | ||
|
||
$ ${TURBO} prune --scope=web --docker | ||
Generating pruned monorepo for web in .*out (re) | ||
- Added shared | ||
- Added util | ||
- Added web | ||
Make sure patches are part of the json output | ||
$ ls out/json | ||
apps | ||
package.json | ||
packages | ||
patches | ||
pnpm-workspace.yaml | ||
|
||
Make sure the pnpm patches section is present | ||
$ cat out/json/package.json | jq '.pnpm.patchedDependencies' | ||
{ | ||
"[email protected]": "patches/[email protected]" | ||
} |
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 |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
"build": "echo 'building'" | ||
}, | ||
"dependencies": { | ||
"is-number": "^7.0.0", | ||
"shared": "workspace:*" | ||
} | ||
} |
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 |
---|---|---|
|
@@ -3,5 +3,10 @@ | |
"packageManager": "[email protected]", | ||
"devDependencies": { | ||
"util": "workspace:*" | ||
}, | ||
"pnpm": { | ||
"patchedDependencies": { | ||
"[email protected]": "patches/[email protected]" | ||
} | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
cli/integration_tests/prune/monorepo_with_root_dep/patches/[email protected]
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,9 @@ | ||
diff --git a/index.js b/index.js | ||
index 27f19b757f7c1186b92c405a213bf0dd9b6cbe95..24315132970b6299c9c158ef5fb75b2e9c0e633d 100644 | ||
--- a/index.js | ||
+++ b/index.js | ||
@@ -1,3 +1,4 @@ | ||
+// patch | ||
/*! | ||
* is-number <https://github.com/jonschlinkert/is-number> | ||
* |
15 changes: 15 additions & 0 deletions
15
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.
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