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.

Offer the bundles the Shopify CLI builds for an app

Țugui Dragoș9f95f2c26af2
diff --git a/Packages/PeelCore/Sources/PeelCore/Developer/ProjectArtifacts.swift b/Packages/PeelCore/Sources/PeelCore/Developer/ProjectArtifacts.swift
index 15197f42..a09d9ad0 100644
--- a/Packages/PeelCore/Sources/PeelCore/Developer/ProjectArtifacts.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Developer/ProjectArtifacts.swift
@@ -232,6 +232,15 @@ public enum ProjectArtifacts {
name: ".swc", markers: ["package.json", ".swcrc"], tool: "SWC", isGeneric: false,
source: "https://github.com/swc-project/website/blob/81b00b1c8cc95477b64efd7f3f7a366a787757bd/apps/website/docs/docs/configuration/compilation.mdx#L671-L675"
),
+ // Only the two bundles: `.shopify` also holds the app's local certificate and key, and its logs.
+ Definition(
+ name: ".shopify/deploy-bundle", markers: ["shopify.app.toml"], tool: "Shopify CLI", isGeneric: false,
+ source: "https://github.com/Shopify/cli/blob/a9f536b4c023c89a9153dab0e31f899203443f5a/packages/app/src/cli/services/deploy/bundle.ts#L24-L26"
+ ),
+ Definition(
+ name: ".shopify/dev-bundle", markers: ["shopify.app.toml"], tool: "Shopify CLI", isGeneric: false,
+ source: "https://github.com/Shopify/cli/blob/a9f536b4c023c89a9153dab0e31f899203443f5a/packages/app/src/cli/services/dev/app-events/app-event-watcher.ts#L105"
+ ),
Definition(
name: ".cache", markers: remixConfigFiles, tool: "Remix", isGeneric: true,
source: "https://github.com/remix-run/remix/blob/5ff6f9a17add06e7f70da48480c1911ad0a1310f/docs/file-conventions/remix-config.md#L70-L73"
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/ProjectArtifactsTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/ProjectArtifactsTests.swift
index 57ac5876..0d5faa82 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/ProjectArtifactsTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/ProjectArtifactsTests.swift
@@ -496,6 +496,20 @@ struct ProjectArtifactsTests {
#expect(found.first?.isRecommended == true)
}
+ @Test func offersTheBundlesTheShopifyCLIBuildsAndNeverItsCertificates() async throws {
+ let directory = try TemporaryDirectory()
+ try directory.file("store/shopify.app.toml", bytes: 16)
+ try directory.file("store/.shopify/deploy-bundle/manifest.json", bytes: 400_000)
+ try directory.file("store/.shopify/dev-bundle/extension/dist/main.js", bytes: 400_000)
+ try directory.file("store/.shopify/localhost-key.pem", bytes: 16)
+ try age(directory.url, days: 60)
+
+ let found = await ProjectArtifacts.scan(roots: [directory.url]).artifacts
+
+ #expect(found.map(\.name).sorted() == [".shopify/deploy-bundle", ".shopify/dev-bundle"])
+ #expect(found.allSatisfy { $0.tool == "Shopify CLI" && $0.isRecommended })
+ }
+
@Test func listsWhatRemixAndReactRouterBuildWithoutSelectingIt() async throws {
let directory = try TemporaryDirectory()
try directory.file("classic/remix.config.js", bytes: 16)