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.

Never select Dart's package store on the Developer page

Țugui Dragoșea5c44efa704
diff --git a/GUIDE.md b/GUIDE.md
index 437302cb..500570fb 100644
--- a/GUIDE.md
+++ b/GUIDE.md
@@ -90,9 +90,10 @@ and the browser profiles a Playwright run left in the temporary folder when it e
browser or an app keeps for you, a profile a browser still has open, a toolchain, or anything holding an account.
Some of what it lists you may want again, so Select Recommended passes it by: Xcode's archives and the symbols it
-copied from your devices, model weights, installed packages, what a tool keeps for you to install again (Vagrant
-boxes, Asset Store packages, Godot's export templates), an editor's saved state for a project that no longer
-exists, and a cache with a wallet, a signing key, or a password database inside. Nothing is selected for you.
+copied from your devices, model weights, installed packages and the stores your projects load them from, such as
+pnpm's and Dart's, what a tool keeps for you to install again (Vagrant boxes, Asset Store packages, Godot's export
+templates), an editor's saved state for a project that no longer exists, and a cache with a wallet, a signing key, or
+a password database inside. Nothing is selected for you.
**Build Artifacts:** what builds left in the folders you choose, like `node_modules`, `DerivedData`, `target`, `.nuxt`,
`__pycache__`, Unity's `Library`, and any folder its tool tagged as a cache (`CACHEDIR.TAG`), each only when a file of
diff --git a/Packages/PeelCore/Sources/PeelCore/Developer/DeveloperCaches.swift b/Packages/PeelCore/Sources/PeelCore/Developer/DeveloperCaches.swift
index 827030e8..301557dc 100644
--- a/Packages/PeelCore/Sources/PeelCore/Developer/DeveloperCaches.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Developer/DeveloperCaches.swift
@@ -649,8 +649,10 @@ public enum DeveloperCaches {
]),
// Other languages
Definition(id: "dart", name: "Dart & Flutter", systemImage: "chevron.left.forwardslash.chevron.right", appBundleIdentifiers: [], folders: [
- Folder(".pub-cache/hosted", .downloads, source: "https://github.com/dart-lang/site-www/blob/0590fb830cc9d02c97d4c71777f902c3a7936d78/src/content/tools/pub/cmd/pub-get.md#L99-L100"),
- Folder(".pub-cache/git", .downloads, source: "https://github.com/dart-lang/pub/blob/90bb91c90cc8edc0d32693f16a4075be6b1e4fce/lib/src/system_cache.dart#L48"),
+ // Every Dart project names its packages' folders here in `.dart_tool/package_config.json`, and pub's own
+ // `cache clean` warns that each project needs `pub get` again, so they are never selected.
+ Folder(".pub-cache/hosted", .environments, source: "https://github.com/dart-lang/site-www/blob/0590fb830cc9d02c97d4c71777f902c3a7936d78/src/content/tools/pub/cmd/pub-get.md#L99-L100"),
+ Folder(".pub-cache/git", .environments, source: "https://github.com/dart-lang/pub/blob/90bb91c90cc8edc0d32693f16a4075be6b1e4fce/lib/src/system_cache.dart#L48"),
Folder(".dartServer/.analysis-driver", .cache, source: "https://github.com/dart-lang/sdk/blob/5c1f33f9ea7d580c0ab58d913da7daa7dafee77a/pkg/analysis_server/lib/src/analysis_server.dart#L737-L741"),
]),
Definition(id: "composer", name: "Composer", systemImage: "chevron.left.forwardslash.chevron.right", appBundleIdentifiers: [], folders: [
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/DeveloperCachesTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/DeveloperCachesTests.swift
index 6a684df0..c62e2696 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/DeveloperCachesTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/DeveloperCachesTests.swift
@@ -706,8 +706,8 @@ struct DeveloperCachesTests {
}
/// A store that installed packages link into is not a download cache. In setups that conda, uv, and pnpm
- /// document, clearing it leaves every installed package linking to nothing, and Yarn's Plug'n'Play projects
- /// load every package from its global cache.
+ /// document, clearing it leaves every installed package linking to nothing, Yarn's Plug'n'Play projects load
+ /// every package from its global cache, and every Dart project names its packages' folders in pub's.
@Test func neverSelectsAStoreInstalledPackagesLinkInto() async throws {
let directory = try TemporaryDirectory()
try directory.file("miniconda3/pkgs/numpy/info.json", bytes: 400_000)
@@ -715,10 +715,12 @@ struct DeveloperCachesTests {
try directory.file("Library/pnpm/store/v10/files/00/abc", bytes: 400_000)
try directory.file("Library/Caches/pnpm/metadata/registry.json", bytes: 400_000)
try directory.file(".yarn/berry/cache/lodash-npm-4.17.21-6382451519-eb835a2e51.zip", bytes: 400_000)
+ try directory.file(".pub-cache/hosted/pub.dev/path-1.9.1/lib/path.dart", bytes: 400_000)
+ try directory.file(".pub-cache/git/path-0123456789abcdef0123456789abcdef01234567/lib/path.dart", bytes: 400_000)
let locations = await scanned(directory.url).flatMap(\.locations)
let suggested = locations.filter(\.isRecommended).map(\.url).map { $0.lastPathComponent }
- #expect(locations.count == 5)
+ #expect(locations.count == 7)
#expect(suggested == ["pnpm"], "a store installed packages link into was suggested")
}