Skip to content
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

Add configuration option to configure .store folder in pnpm mode #6710

Merged
merged 2 commits into from
Mar 5, 2025

Conversation

dannyvv
Copy link
Contributor

@dannyvv dannyvv commented Mar 4, 2025

This changes adds a configuration option to configure node_modules/.store folder when using nodeLinker: pnpm.
It adds an option pnpmStoreFolder to .yarnrc.yml which will be used when installing with pnpm Mode.

What's the problem this PR addresses?

In our CI system we run a few copies of js repos for different architectures in parralel. We want to share the .store folder between the multiple runs, so we have to hoist it outside of the sourceroot.
This adds an option to configure this.

nodeLinker: pnpm
pnpmStoreFolder: ../cache/.store

Resolves #6623

...

How did you fix it?

  • Added configuration field to plugin-pnpm that defines the new option pnpmStoreFolder
    I'm open to naming suggestions.
    I just followed the pattern defined by plugin-nm of prefixing settings with the plugin name like nmHoistingLimits, nmMode & nmSelfReferences. As well as by plugin-pnp with setting pnpUnpluggedFolder
    I followed the Folder suffix to match cacheFolder, patchFolder, globalFolder, virtualFolder & pnpUnpluggedFolder.
  • Updated the function getStoreLocation(project: Project) to get the setting from the configuration rather than a hardcoded default.
  • Add type for configuration to match other built-in plugins
  • Add documentation to docusaurus json file (local testing for this failed)
  • Added a unittest that makes sure the links are correct

...

Checklist

  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

@dannyvv dannyvv force-pushed the pr/AddStore branch 6 times, most recently from 89364ef to ee321d3 Compare March 4, 2025 17:55
@dannyvv dannyvv marked this pull request as ready for review March 4, 2025 18:12
@dannyvv
Copy link
Contributor Author

dannyvv commented Mar 4, 2025

FYI to reviewers:

  • Last evening/night (PST timezone) netlify/yarn4/deploy-preview was consistently failing. It passed now without changes. I'll let you be the judge if it is flackyness of my change or the netlify infrastructure...
  • Looks like GH is doing a brownout test of deprecating Ubuntu 20.04:
    This is a scheduled Ubuntu 20.04 brownout. Ubuntu 20.04 LTS runner will be removed on 2025-04-01. 
    For more details, see https://github.com/actions/runner-images/issues/11101
    
    I doublechecked and the steps are declaring ubuntu-latest so not sure what happened....
    I'll try to rerun a bit later.

@arcanis arcanis merged commit 3c8a90a into yarnpkg:master Mar 5, 2025
15 of 26 checks passed
@arcanis
Copy link
Member

arcanis commented Mar 5, 2025

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Configurable location of node_modules/.store with nodeLinker: pnpm
2 participants