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.

npm's logs, Yarn's metadata, Expo, Bun, Corepack, nvm, Prisma, and browser drivers

Țugui Dragoșd1af49ef7e0a
diff --git a/Packages/PeelCore/Sources/PeelCore/Developer/DeveloperCaches.swift b/Packages/PeelCore/Sources/PeelCore/Developer/DeveloperCaches.swift
index bd98de02..f859b0be 100644
--- a/Packages/PeelCore/Sources/PeelCore/Developer/DeveloperCaches.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Developer/DeveloperCaches.swift
@@ -150,12 +150,14 @@ public enum DeveloperCaches {
Definition(id: "npm", name: "npm", systemImage: "cube", appBundleIdentifiers: [], folders: [
Folder(".npm/_cacache", .downloads, source: "https://github.com/npm/cli/blob/latest/workspaces/config/lib/definitions/definitions.js#L443"),
Folder(".npm/_npx", .downloads, source: "https://github.com/npm/cli/blob/latest/workspaces/config/lib/definitions/definitions.js#L444"),
+ Folder(".npm/_logs", .logs, source: "https://github.com/npm/cli/blob/latest/workspaces/config/lib/definitions/definitions.js#L1481-L1486"),
]),
Definition(id: "yarn", name: "Yarn", systemImage: "cube", appBundleIdentifiers: [], folders: [
Folder("Library/Caches/Yarn", .downloads, source: "https://github.com/yarnpkg/yarn/blob/master/src/util/user-dirs.js#L32-L33"),
// Yarn's Plug'n'Play projects load every package from this cache, so it is listed and never selected:
// moving it breaks each such project until `yarn install` runs in it again.
Folder(".yarn/berry/cache", .environments, source: "https://github.com/yarnpkg/berry/blob/master/packages/yarnpkg-core/sources/Configuration.ts"),
+ Folder(".yarn/berry/metadata", .cache, source: "https://github.com/yarnpkg/berry/blob/master/packages/plugin-npm/sources/npmHttpUtils.ts#L317"),
]),
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"),
@@ -165,6 +167,7 @@ public enum DeveloperCaches {
// Bun's global virtual store, once turned on, is `links`, and every project's `node_modules` then points
// into it (Bun's documentation, "Global virtual store").
Folder(".bun/install/cache", .downloads, source: "https://github.com/oven-sh/bun/blob/main/docs/pm/global-store.mdx", storeInside: "links"),
+ Folder("Library/Caches/bun", .cache, source: "https://github.com/oven-sh/bun/blob/main/src/jsc/RuntimeTranspilerCache.rs#L657-L660"),
]),
Definition(id: "deno", name: "Deno", systemImage: "chevron.left.forwardslash.chevron.right", appBundleIdentifiers: [], folders: [
// `DENO_DIR` keeps the REPL history (`deno_history.txt`) and what scripts store (`location_data`)
@@ -187,15 +190,34 @@ public enum DeveloperCaches {
Folder(".expo/versions-cache", .cache, source: "https://github.com/expo/expo/blob/main/packages/@expo/cli/src/api/getVersions.ts#L47"),
Folder(".expo/ios-simulator-app-cache", .downloads, source: "https://github.com/expo/expo/blob/main/packages/@expo/cli/src/utils/downloadExpoGoAsync.ts#L21"),
Folder(".expo/android-apk-cache", .downloads, source: "https://github.com/expo/expo/blob/main/packages/@expo/cli/src/utils/downloadExpoGoAsync.ts#L27"),
+ Folder(".expo/schema-cache", .cache, source: "https://github.com/expo/expo/blob/main/packages/@expo/cli/src/api/getExpoSchema.ts#L83"),
+ Folder(".expo/native-modules-cache", .cache, source: "https://github.com/expo/expo/blob/main/packages/@expo/cli/src/api/getNativeModuleVersions.ts#L35"),
]),
Definition(id: "nx", name: "Nx", systemImage: "cube", appBundleIdentifiers: [], folders: [
// One workspace's `cache` and `databases`, named by 16 hex digits of a hash. They go together: Nx
// answers a cache hit from the database alone, and a database without its cache restores nothing.
Folder(".nx/" + String(repeating: "[0-9a-f]", count: 16), .buildData, source: "https://github.com/nrwl/nx/blob/master/packages/nx/src/utils/cache-directory.ts"),
]),
+ // The package manager versions Corepack downloaded. `lastKnownGood.json` beside them holds the ones a person chose.
+ Definition(id: "corepack", name: "Corepack", systemImage: "cube", appBundleIdentifiers: [], folders: [
+ Folder(".cache/node/corepack/v1", .downloads, source: "https://github.com/nodejs/corepack/blob/main/sources/folderUtils.ts"),
+ ]),
+ Definition(id: "nvm", name: "nvm", systemImage: "cube", appBundleIdentifiers: [], folders: [
+ Folder(".nvm/.cache", .downloads, source: "https://github.com/nvm-sh/nvm/blob/master/nvm.sh#L3337-L3338"),
+ ]),
+ Definition(id: "prisma", name: "Prisma", systemImage: "cube", appBundleIdentifiers: [], folders: [
+ Folder(".cache/prisma", .downloads, source: "https://github.com/prisma/prisma/blob/7.10.0/packages/fetch-engine/src/utils.ts#L38-L40"),
+ ]),
Definition(id: "playwright", name: "Playwright", systemImage: "globe", appBundleIdentifiers: [], folders: [
Folder("Library/Caches/ms-playwright", .downloads, source: "https://github.com/microsoft/playwright/blob/main/docs/src/browsers.md#L958"),
]),
+ Definition(id: "playwrightgo", name: "Playwright for Go", systemImage: "globe", appBundleIdentifiers: [], folders: [
+ Folder("Library/Caches/ms-playwright-go", .downloads, source: "https://github.com/playwright-community/playwright-go/blob/main/run.go#L370-L372"),
+ ]),
+ // The drivers and browsers Selenium Manager keeps, and not `se-config.toml`, its settings, beside them.
+ Definition(id: "selenium", name: "Selenium Manager", systemImage: "globe", appBundleIdentifiers: [], folders: [
+ Folder(".cache/selenium/*/", .downloads, source: "https://github.com/SeleniumHQ/seleniumhq.github.io/blob/trunk/website_and_docs/content/documentation/selenium_manager.en.md#L34"),
+ ]),
Definition(id: "cypress", name: "Cypress", systemImage: "globe", appBundleIdentifiers: [], folders: [
Folder("Library/Caches/Cypress", .downloads, source: "https://github.com/cypress-io/cypress-documentation/blob/main/docs/app/get-started/advanced-installation.mdx#L615"),
]),
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/DeveloperCachesTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/DeveloperCachesTests.swift
index afe6ac26..be8fd302 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/DeveloperCachesTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/DeveloperCachesTests.swift
@@ -142,7 +142,7 @@ struct DeveloperCachesTests {
/// Toolchains, environments, and anything holding an account are installations or secrets, not caches.
@Test func neverListsToolchainsOrCredentials() {
let forbidden = [
- ".rustup", ".pyenv", ".nvm", ".sdkman", ".rbenv", ".jenv", "nix/store", ".nix-profile", ".asdf", ".volta",
+ ".rustup", ".pyenv", ".sdkman", ".rbenv", ".jenv", "nix/store", ".nix-profile", ".asdf", ".volta",
"conda/envs", "miniconda3/envs", "anaconda3/envs", ".local/pipx",
"Library/Android/sdk", "flutter/bin",
".aws", ".ssh", ".gnupg", ".netrc", ".docker/config", ".kube/config", ".npmrc",
@@ -157,10 +157,13 @@ struct DeveloperCachesTests {
"Library/Application Support/nomic.ai/GPT4All", "Library/Application Support/Adobe/Common",
// Coursier keeps the JVMs `cs java` installs beside its cache; a legacy `~/.ccache` holds `ccache.conf`.
"Library/Caches/Coursier", ".ccache",
+ // Corepack keeps the package manager versions a person chose in `lastKnownGood.json` beside its downloads.
+ ".cache/node/corepack",
]
// CocoaPods' spec repositories hold the ones a person added, which can carry unpushed work: only the CDN copy
- // of the public index, `trunk`, is a cache.
- let onlyThisPart = [".cocoapods/repos": ".cocoapods/repos/trunk"]
+ // of the public index, `trunk`, is a cache. nvm's folder is nvm and every Node it installed; only its download
+ // cache is one.
+ let onlyThisPart = [".cocoapods/repos": ".cocoapods/repos/trunk", ".nvm": ".nvm/.cache"]
for definition in DeveloperCaches.definitions {
for path in definition.folders.map(\.path) {
for pattern in forbidden {