-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(prune) allow pruning of projects using Yarn PnP (#5019)
### Description We have had Yarn2+ support* for quite awhile now. This PR is one of the final steps to remove that asterisks and allow Yarn PnP to be used. A note is that we currently don't copy over the `.pnp.cjs` file or the `.yarn/cache` which are required for [zero installs](https://yarnpkg.com/features/zero-installs). We skip this a naive copy would cause Docker cache misses in the same way a naive copy of the lockfile would. Future work can include correctly pruning this file and directory to allow for the `yarn install` on a cache miss to be even faster. ### Testing Instructions Manual testing that `yarn install --immutable` works for PnP projects. Added an integration test that verifies we no longer throw when trying to prune a PnP project and that we don't copy over files that would bust the cache. --------- Co-authored-by: Chris Olszewski <Chris Olszewski>
- Loading branch information
1 parent
29ea4ab
commit e4dc7dc
Showing
4 changed files
with
16 additions
and
38 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
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
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Setup | ||
$ . ${TESTDIR}/../../../helpers/setup.sh | ||
$ . ${TESTDIR}/../_helpers/copy_fixture.sh $(pwd) berry_resolutions | ||
Remove linker override | ||
$ rm .yarnrc.yml | ||
Prune the project | ||
$ ${TURBO} prune --scope=a | ||
Generating pruned monorepo for a in .*out (re) | ||
- Added a | ||
|
||
Verify that .pnp.cjs isn't coppied causing unnecessary cache misses | ||
$ ls -A out/ | ||
package.json | ||
packages | ||
yarn.lock |