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

docs: correct default globalFolder in docs #6003

Merged
merged 1 commit into from
Dec 21, 2023

Conversation

blimmer
Copy link
Contributor

@blimmer blimmer commented Dec 7, 2023

What's the problem this PR addresses?

Currently, the documentation states that the default globalFolder location is ~/.yarn/berry/global. However, based on my testing, this is not accurate.

 docker run -it --entrypoint bash node:20
root@29746f15333c:/# mkdir test-berry
root@29746f15333c:/# cd test-berry/
root@29746f15333c:/test-berry# yarn init -y
yarn init v1.22.19
warning The yes flag has been set. This will automatically answer yes to all questions, which may have security implications.
success Saved package.json
Done in 0.02s.
root@29746f15333c:/test-berry# cat package.json
{
  "name": "test-berry",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT"
}
root@29746f15333c:/test-berry# yarn set version berry
➤ YN0000: Retrieving https://repo.yarnpkg.com/4.0.2/packages/yarnpkg-cli/bin/yarn.js
➤ YN0000: Saving the new release in .yarn/releases/yarn-4.0.2.cjs
➤ YN0000: Done in 0s 322ms
root@29746f15333c:/test-berry# corepack enable
root@29746f15333c:/test-berry# yarn --version
4.0.2
root@29746f15333c:/test-berry# echo 'enableGlobalCache: true' > .yarnrc.yml
root@29746f15333c:/test-berry# yarn add semver
➤ YN0000: · Yarn 4.0.2
➤ YN0000: ┌ Resolution step
➤ YN0085: │ + semver@npm:7.5.4, lru-cache@npm:6.0.0, yallist@npm:4.0.0
➤ YN0000: └ Completed in 0s 342ms
➤ YN0000: ┌ Fetch step
➤ YN0013: │ 3 packages were added to the project (+ 130.97 KiB).
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed
➤ YN0000: · Done in 0s 516ms
root@29746f15333c:/test-berry# ls ~/.yarn/berry/
cache  index  metadata	telemetry.json
root@29746f15333c:/test-berry# ls ~/.yarn/berry/cache/
lru-cache-npm-6.0.0-b4c8668fe1-10c0.zip  yallist-npm-4.0.0-b493d9e907-10c0.zip
semver-npm-7.5.4-c4ad957fcd-10c0.zip

As you can see, the globalFolder appears to be ~/.yarn/berry, not ~/.yarn/berry/global. This also appears to be true in code:

return ppath.resolve(getHomeFolder(), `.yarn/berry`);

How did you fix it?

I updated the documentation to reference the correct default globalPath.

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.

@arcanis
Copy link
Member

arcanis commented Dec 21, 2023

It's not the default value, it's an example value. No harm in updating it, though 👍

@arcanis arcanis merged commit f67dda8 into yarnpkg:master Dec 21, 2023
21 of 23 checks passed
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.

2 participants