toggle-local-spm 3.0.0 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 95dce0fa2cf61cbaf30572bb310d82190cc2226d2214ab0ed71d6ca9cb4c42bd
4
- data.tar.gz: d0348db3691d867a3f9d8fe7d4b6a11890e6b5bc8b20f0bad2d0e5a4f09575d1
3
+ metadata.gz: f9691f6ecf52ba5b91dc52c36ad66f5f913a71631a146549364db2b1e4d90e96
4
+ data.tar.gz: a062ad1bd784e7cb2d9903fd57851791dfce5536ce500bc6b11e351e56f63eeb
5
5
  SHA512:
6
- metadata.gz: 859a3fa360d122b07a3fcd9f64cfff74cde70896935daa8309034df4f9a64dcba1e5c45f9ff1ef4fb05106439158e6ef3008f7d891110bba6045a5fd75666a17
7
- data.tar.gz: 6bd2a0f5b172b59d11fe6ba00e556b6358c1d865f3ea02261547f161de2870baff33daed52f5c1921e9fc584014525d5d82bc0000109dad48404235fe3ef7e89
6
+ metadata.gz: afd83f5a122b1f0c51a4ea075b99e122daf8a13f2d31b209d9b5680defd71799bf5b61872d4431e629bfecd987962acce293e3e3342cd90f8f3d4984f0a1cebe
7
+ data.tar.gz: fc4c558a7d77f11569f9990b4e972eb131bb81a3c2dd47ac7f51bdea35ade8e762d00706dcfb010baac8ba7b9c73f156fc12b28255310488e0293b2a363a5d39
data/README.md CHANGED
@@ -73,14 +73,20 @@ bundle exec toggle-local-spm
73
73
 
74
74
  The interactive menu lists every direct dependency (from the project itself)
75
75
  and every indirect one (from `Package.resolved`) as a table, each tagged with
76
- its type, current state, and whether it has a record in
77
- `spm-local-overrides.json` (see below), e.g.:
76
+ its type, current state, and whether it has a known local checkout recorded
77
+ in `spm-local-overrides.json` (see below), followed by a legend explaining
78
+ the Managed column, e.g.:
78
79
 
79
80
  ```
80
81
  # Package Type State Managed
81
- 1 my-shared-ios 🎯 direct 🌏 remote
82
+ 1 my-shared-ios 🎯 direct 📁 local
82
83
  2 DeviceKit 🎯 direct 🌏 remote
83
- 3 my-model-lib 🧩 indirect 🌏 remote
84
+ 3 my-model-lib 🧩 indirect 🌏 remote 📁
85
+
86
+ Legend:
87
+ ✅ Local mock set
88
+ 📁 Mock not set. Mock found (recorded in spm-local-overrides.json)
89
+ Blank — no record for this dependency in spm-local-overrides.json
84
90
  ```
85
91
 
86
92
  Each package toggles independently based on what's currently wired up in the
@@ -41,7 +41,7 @@ module ToggleLocalSpm
41
41
  LocalRef = Xcodeproj::Project::Object::XCLocalSwiftPackageReference
42
42
  ProductDependency = Xcodeproj::Project::Object::XCSwiftPackageProductDependency
43
43
 
44
- Candidate = Struct.new(:name, :ref, :type, :resolved_entry, :managed) do
44
+ Candidate = Struct.new(:name, :ref, :type, :resolved_entry, :tracked) do
45
45
  def local?
46
46
  ref.is_a?(LocalRef)
47
47
  end
@@ -50,6 +50,13 @@ module ToggleLocalSpm
50
50
  TYPE_LABELS = { "direct" => "🎯 direct", "indirect" => "🧩 indirect" }.freeze
51
51
  STATE_LABELS = { local: "📁 local", remote: "🌏 remote" }.freeze
52
52
 
53
+ MANAGED_LABELS = { set: "✅", found: "📁" }.freeze
54
+ MANAGED_LEGEND = [
55
+ "#{MANAGED_LABELS[:set]} Local mock set",
56
+ "#{MANAGED_LABELS[:found]} Mock not set. Mock found (recorded in spm-local-overrides.json)",
57
+ " Blank — no record for this dependency in spm-local-overrides.json"
58
+ ].freeze
59
+
53
60
  def self.run(argv)
54
61
  new(argv).run
55
62
  end
@@ -242,10 +249,13 @@ module ToggleLocalSpm
242
249
  candidates.each_with_index do |c, i|
243
250
  type_label = TYPE_LABELS.fetch(c.type, c.type).ljust(type_width)
244
251
  state_label = STATE_LABELS[c.local? ? :local : :remote].ljust(state_width)
245
- managed_label = c.managed ? "✅" : ""
246
- puts " #{(i + 1).to_s.rjust(index_width)} #{c.name.ljust(name_width)} #{type_label} #{state_label} #{managed_label}"
252
+ puts " #{(i + 1).to_s.rjust(index_width)} #{c.name.ljust(name_width)} #{type_label} #{state_label} #{managed_label_for(c)}"
247
253
  end
248
254
 
255
+ puts
256
+ puts "Legend:"
257
+ MANAGED_LEGEND.each { |line| puts " #{line}" }
258
+
249
259
  print "\n> "
250
260
  choice = $stdin.gets&.strip
251
261
  abort_with("invalid selection") if choice.nil? || choice.empty?
@@ -260,6 +270,12 @@ module ToggleLocalSpm
260
270
  end.uniq
261
271
  end
262
272
 
273
+ def managed_label_for(candidate)
274
+ return "" unless candidate.tracked
275
+
276
+ candidate.local? ? MANAGED_LABELS[:set] : MANAGED_LABELS[:found]
277
+ end
278
+
263
279
  # --- Toggling -------------------------------------------------------
264
280
 
265
281
  def toggle(project, xcodeproj_path, candidate, state)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ToggleLocalSpm
4
- VERSION = "3.0.0"
4
+ VERSION = "3.0.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: toggle-local-spm
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sushant Verma
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-08-23 00:00:00.000000000 Z
11
+ date: 2026-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xcodeproj