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

feat!: set default nmMode to hardlinks-local #4504

Merged
merged 2 commits into from
Jun 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .yarn/versions/f73c4856.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
releases:
"@yarnpkg/plugin-nm": major

declined:
- "@yarnpkg/cli"
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Yarn now accepts sponsorships! Please give a look at our [OpenCollective](https:
- Plugins cannot access the Clipanion 2 APIs anymore (upgrade to [Clipanion 3](https://github.com/arcanis/clipanion))
- Plugins cannot access the internal copy of Yup anymore (use [Typanion](https://github.com/arcanis/typanion) instead)
- The network settings configuration option has been renamed from `caFilePath` to `httpsCaFilePath`.
- Set `nmMode` to `hardlinks-local` by default.

### **API Changes**

Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby/static/configuration/yarnrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@
"description": "If set to `hardlinks-local` Yarn will utilize hardlinks to reduce disk space consumption inside `node_modules` directories in a current project. With `hardlinks-global` Yarn will use global content addressable storage to reduce `node_modules` size across all the projects using this option.",
"type": "string",
"enum": ["classic", "hardlinks-local", "hardlinks-global"],
"default": "classic"
"default": "hardlinks-local"
},
"nodeLinker": {
"_package": "@yarnpkg/plugin-pnp",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-nm/sources/NodeModulesLinker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ async function findInstallState(project: Project, {unrollAliases = false}: {unro
if (locatorState.__metadata.version > STATE_FILE_VERSION)
return null;

const nmMode = locatorState.__metadata.nmMode || NodeModulesMode.CLASSIC;
const nmMode = locatorState.__metadata.nmMode || NodeModulesMode.HARDLINKS_LOCAL;

const locatorMap: NodeModulesLocatorMap = new Map();
const binSymlinks: BinSymlinkMap = new Map();
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-nm/sources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const plugin: Plugin<Hooks> = {
NodeModulesMode.HARDLINKS_LOCAL,
NodeModulesMode.HARDLINKS_GLOBAL,
],
default: NodeModulesMode.CLASSIC,
default: NodeModulesMode.HARDLINKS_LOCAL,
},
nmSelfReferences: {
description: `If set to 'false' the workspace will not be allowed to require itself and corresponding self-referencing symlink will not be created`,
Expand Down