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 +4 -4
- data/README.md +10 -4
- data/lib/toggle_local_spm/cli.rb +19 -3
- data/lib/toggle_local_spm/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f9691f6ecf52ba5b91dc52c36ad66f5f913a71631a146549364db2b1e4d90e96
|
|
4
|
+
data.tar.gz: a062ad1bd784e7cb2d9903fd57851791dfce5536ce500bc6b11e351e56f63eeb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
|
77
|
-
`spm-local-overrides.json` (see below),
|
|
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
|
|
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
|
data/lib/toggle_local_spm/cli.rb
CHANGED
|
@@ -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, :
|
|
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
|
-
|
|
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)
|
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.
|
|
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-
|
|
11
|
+
date: 2026-08-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: xcodeproj
|