Skip to content

feat: Allow global yarnrc in XDG Base Directory compliant location #5113

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

j-px
Copy link

@j-px j-px commented Dec 4, 2022

What's the problem this PR addresses?

Implements #3245, allowing .yarnrc.yml to be at $XDG_CONFIG_HOME/yarn/.yarnrc.yml (~/.config/yarn/.yarnrc.yml), but also still at ~/.yarnrc.yml. Both at the same time isn't allowed though, then only ~/.yarnrc.yml gets used/parsed.

How did you fix it?

Changed the home rc file finder in yarnpkg-core's Configuration.ts to find an XDG Base Directory rc file if ~/.yarnrc.yml doesn't exist.

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.

Copy link
Member

@arcanis arcanis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My original concerns still stand:

Conceptually I know XDG is a good idea, but having a single consistent location for all global configuration makes debugging/support quite easier when all we have to say it's "check ~/.yarnrc.yml". I personally don't think XDG is worth losing that...

@j-px
Copy link
Author

j-px commented Dec 4, 2022

Maybe you could instead link a .yarnrc.yml docs page which mentions where the global one can be.

@Tatsh
Copy link

Tatsh commented Mar 15, 2024

My original concerns still stand:

Conceptually I know XDG is a good idea, but having a single consistent location for all global configuration makes debugging/support quite easier when all we have to say it's "check ~/.yarnrc.yml". I personally don't think XDG is worth losing that...

This PR still lets ~/.yarnrc.yml exist and users by default will have the file at that location. If someone chooses to use XDG path instead it would be their conscious decision and they ought to remember. So you could say 'check ~/.yarnrc.yml or equivalent'.

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.

4 participants