Skip to content

armgit / peel

Public Imported from GitHub
0

Uninstall Mac apps with every file they leave behind, and see why each belongs. Free up space, fine-tune macOS, and set up Terminal.

Developer lists the store older pnpm kept in the home folder

Țugui Dragoș545285fe28b4
diff --git a/Packages/PeelCore/Sources/PeelCore/Developer/DeveloperCaches.swift b/Packages/PeelCore/Sources/PeelCore/Developer/DeveloperCaches.swift
index 80fe829c..ce3fb28e 100644
--- a/Packages/PeelCore/Sources/PeelCore/Developer/DeveloperCaches.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Developer/DeveloperCaches.swift
@@ -321,6 +321,7 @@ public enum DeveloperCaches {
]),
Definition(id: "pnpm", name: "pnpm", systemImage: "cube", appBundleIdentifiers: [], folders: [
Folder("Library/pnpm/store", .environments, source: "https://github.com/pnpm/pnpm.io/blob/main/docs/settings/store.md#L15"),
+ Folder(".pnpm-store", .environments, source: "https://github.com/pnpm/pnpm.io/blob/main/versioned_docs_archived/version-6.x/npmrc.md#L95-L100"),
Folder("Library/Caches/pnpm", .cache, source: "https://github.com/pnpm/pnpm.io/blob/main/docs/settings/other.md#L175"),
]),
Definition(id: "bun", name: "Bun", systemImage: "cube", appBundleIdentifiers: [], folders: [
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/DeveloperCachesTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/DeveloperCachesTests.swift
index b52bde9d..f1d837a9 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/DeveloperCachesTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/DeveloperCachesTests.swift
@@ -224,7 +224,7 @@ struct DeveloperCachesTests {
// The only top-level entries in the table, each owned outright by the one tool that made it.
let ownedOutright: Set<String> = [
".ccache", ".electron-gyp", ".gitlibs", ".node-gyp", ".virtualenvs", "nltk_data", "tensorflow_datasets",
- ".zcompdump*",
+ ".zcompdump*", ".pnpm-store",
]
for definition in DeveloperCaches.definitions {
for path in definition.folders.map(\.path) {
@@ -896,6 +896,17 @@ struct DeveloperCachesTests {
#expect(locations.map(\.url.lastPathComponent) == ["cache"])
}
+ @Test func listsTheStoreOlderPnpmKeptInTheHomeFolderWithoutSelectingIt() async throws {
+ let directory = try TemporaryDirectory()
+ try directory.file(".pnpm-store/v3/files/00/abc", bytes: 400_000)
+ let pnpm = DeveloperCaches.definitions.filter { $0.id == "pnpm" }
+
+ let locations = await DeveloperCaches.scan(pnpm, homeDirectory: directory.url).flatMap(\.locations)
+
+ #expect(locations.map(\.url.lastPathComponent) == [".pnpm-store"])
+ #expect(locations.first?.isRecommended == false)
+ }
+
/// virtualenvwrapper keeps the user's hook scripts beside the environments in `~/.virtualenvs`, so only the
/// environments are offered, and a link among them is left where it is, never followed.
@Test func offersVirtualenvwrappersEnvironmentsAndNotItsHooks() async throws {