Skip to content

Commit

Permalink
revert: use the same directories on macOS as on Linux (#7842)
Browse files Browse the repository at this point in the history
* revert: use the same directories on macOS as on Linux

This reverts commit b970d96.

* docs: revert changesets

* feat!: change state directory on macOS

---------

Co-authored-by: Zoltan Kochan <z@kochan.io>
  • Loading branch information
gluxon and zkochan committed Mar 31, 2024
1 parent 6caec81 commit 2d9e3b8
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
6 changes: 6 additions & 0 deletions .changeset/fresh-boats-press.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@pnpm/config": major
"pnpm": major
---

Use the same directory for state files on macOS as on Linux (`~/.local/state/pnpm`).
6 changes: 0 additions & 6 deletions .changeset/silly-moles-rhyme.md

This file was deleted.

9 changes: 9 additions & 0 deletions config/config/src/dirs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ export function getCacheDir (
if (opts.env.XDG_CACHE_HOME) {
return path.join(opts.env.XDG_CACHE_HOME, 'pnpm')
}
if (opts.platform === 'darwin') {
return path.join(os.homedir(), 'Library/Caches/pnpm')
}
if (opts.platform !== 'win32') {
return path.join(os.homedir(), '.cache/pnpm')
}
Expand Down Expand Up @@ -49,6 +52,9 @@ export function getDataDir (
if (opts.env.XDG_DATA_HOME) {
return path.join(opts.env.XDG_DATA_HOME, 'pnpm')
}
if (opts.platform === 'darwin') {
return path.join(os.homedir(), 'Library/pnpm')
}
if (opts.platform !== 'win32') {
return path.join(os.homedir(), '.local/share/pnpm')
}
Expand All @@ -67,6 +73,9 @@ export function getConfigDir (
if (opts.env.XDG_CONFIG_HOME) {
return path.join(opts.env.XDG_CONFIG_HOME, 'pnpm')
}
if (opts.platform === 'darwin') {
return path.join(os.homedir(), 'Library/Preferences/pnpm')
}
if (opts.platform !== 'win32') {
return path.join(os.homedir(), '.config/pnpm')
}
Expand Down
6 changes: 3 additions & 3 deletions config/config/test/dirs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ test('getCacheDir()', () => {
expect(getCacheDir({
env: {},
platform: 'darwin',
})).toBe(path.join(os.homedir(), '.cache/pnpm'))
})).toBe(path.join(os.homedir(), 'Library/Caches/pnpm'))
expect(getCacheDir({
env: {
LOCALAPPDATA: '/localappdata',
Expand Down Expand Up @@ -76,7 +76,7 @@ test('getDataDir()', () => {
expect(getDataDir({
env: {},
platform: 'darwin',
})).toBe(path.join(os.homedir(), '.local/share/pnpm'))
})).toBe(path.join(os.homedir(), 'Library/pnpm'))
expect(getDataDir({
env: {
LOCALAPPDATA: '/localappdata',
Expand All @@ -103,7 +103,7 @@ test('getConfigDir()', () => {
expect(getConfigDir({
env: {},
platform: 'darwin',
})).toBe(path.join(os.homedir(), '.config/pnpm'))
})).toBe(path.join(os.homedir(), 'Library/Preferences/pnpm'))
expect(getConfigDir({
env: {
LOCALAPPDATA: '/localappdata',
Expand Down
1 change: 0 additions & 1 deletion pnpm/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
- Support for lockfile v5 is dropped. Use pnpm v8 to convert lockfile v5 to lockfile v6 [#7470](https://github.com/pnpm/pnpm/pull/7470).
- The [`dedupe-injected-deps`](https://pnpm.io/npmrc#dedupe-injected-deps) setting is `true` by default.
- The default value of the `link-workspace-packages` setting changed from `true` to `false`. This means that by default, dependencies will be linked from workspace packages only when they are specified using the [workspace protocol](https://pnpm.io/workspaces#workspace-protocol-workspace).
- Use the same directories on macOS as on Linux. Don't use directories inside `~/Library` on macOS [#7321](https://github.com/pnpm/pnpm/issues/7321).
- The default value of the [hoist-workspace-packages](https://pnpm.io/npmrc#hoist-workspace-packages) is `true`.
- `pnpm licenses list` prints license information of all versions of the same package in case different versions use different licenses. The format of the `pnpm licenses list --json` output has been changed [#7528](https://github.com/pnpm/pnpm/pull/7528).
- A new command added for printing completion code to the console: `pnpm completion [shell]`. The old command that modified the user's shell dotfiles has been removed [#3083](https://github.com/pnpm/pnpm/issues/3083).
Expand Down

0 comments on commit 2d9e3b8

Please sign in to comment.