-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Yarn Plug'n'Play: Implementation #6382
Conversation
Branch: yarn-node-pnp
Branch: pkg-tests
Branch: pnp-map-improvements
Branch: lifecycle-wrappers-remove-option
…ight binaries Branch: lifecycle-wrappers-tests
Branch: lifecycle-wrappers-flowlint
… been installed Branch: lifecycle-wrappers-improve-pnp-error
Branch: lifecycle-wrappers-main
Remove the scriptsPrependNodePath option
Lifecycle wrappers tests
Lifecycle wrappers flowlint
Lifecycle wrappers improve pnp error
Lifecycle wrappers
Adds .pnp.js files to the gitignore
…annot be resolved
Fallbacks to the toplevel dependencies when a transitive dependency is missing
Branch: pkg-tests-helper-definition
…nd peer dependencies Branch: dev-peer-fixtures
…ental`) Branch: option-plugnplay-experimental
Branch: pnp-peer-dependencies-failing
Fixes an issue inside the pkg-tests helper
Improves the fixtures
Implements `plugnplay-experimental`
Adds a new test for peer dependencies
Prettifies the generated pnp files
Not yet, I want to release it as 1.11 first (meaning that I won't merge the PR that adds support for PnP to Yarn itself right now). But yeah, it will make the 2.0 release more pressing. I'd have preferred if we could have had more work done on the breaking changes we listed in the 2.0 thread, but we can postpone it to the next major bump. |
@@ -219,7 +219,7 @@ describe('with focus', () => { | |||
true, | |||
); | |||
expect(await linkAt(config, 'node_modules', '.bin', 'example-yarn-workspace-2')).toEqual( | |||
'../example-yarn-workspace-2/index.js', | |||
'../../../example-yarn-workspace-2/index.js', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting .. I've simply updated this test, since the new value seems more correct to me. The extra ../..
is required to jump out of node_modules/.bin
(the linkAt
function just reads the symlink as it is, it doesn't make it relative to anything special).
I now remember why the focus tests were skipped - #5967 is blocking them 😞 |
This reverts commit 84358aa.
@arcanis can I use Yarn Plug'n'Play in yarn |
@pustovalov just in nightly afaik |
The 1.11 branch (currently prerelease) also has PnP enabled! Master (ie nightlies) is slightly more up-to-date though, and contains a few bugfixes for some edge cases. |
Right, 1.11-nightly already had it. Missed that it is already in the prerelease. |
Thx |
yarnpkg#6382 (e905f74) made this option obsolete.
yarnpkg#6382 (e905f74) made this unnecessary.
* Delete unused scriptsPrependNodePath config option. #6382 (e905f74) made this option obsolete. * Do not prepend the node exec path. #6382 (e905f74) made this unnecessary. * Update CHANGELOG.md * Clarify in changelog the --scripts-prepend-node-path is removed because it is obsolete The current behavior after this PR is not to make `--scripts-prepend-node-path` always on, but to have a better default behavior than the option provided.
Hi folks,
This PR implements the Plug'n'Play feature for Yarn (check the link to go to the formal RFC that details the motivations behind this project, and rational behind the design choices). It's a large PR so please bear with me! I preserved the individual commits intact in case you want to see the history of the project.
Without further ado, this PR:
.pnp.js
to be generated in place of thenode_modules
.pnp
to be created - the content of this directory is opaque (cf RFC){"installConfig": {"pnp": true}}
yarn --pnp
andyarn --disable-pnp
, which toggle Plug'n'Play permanently for a projectYARN_PLUGNPLAY_OVERRIDE
which can override the Plug'n'Play settings without persisting ityarn unplug
which copies a specific package from the cache to a temporary folder for debugging purposes - note that this command isn't meant to be used a part of regular installation workflows.yarn run
to always use the exact same version of both Yarn and Node than the ones Yarn is using itself at the moment (fixes Node executable path always prepended to PATH when running a package.json script #5935 permanently).Since I can guess you're interested into trying it out now, you can find a build attached to this PR. You also can try out this playground for an easy way to test the feature with all sort of tools (note that we'll gladly accept contributions there to add new ones!).
cc @yarnpkg/maintainers