Skip to content

Commit

Permalink
feat: set default nmMode to hardlinks-local
Browse files Browse the repository at this point in the history
  • Loading branch information
jdanil committed May 29, 2022
1 parent d1961ee commit 7fc967b
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .yarn/versions/f73c4856.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
releases:
"@yarnpkg/plugin-nm": major
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Yarn now accepts sponsorships! Please give a look at our [OpenCollective](https:
- Some legacy layers have been sunset:
- 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)
- 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

0 comments on commit 7fc967b

Please sign in to comment.