Skip to content

Commit 6bfe204

Browse files
Merge pull request #47 from nikolainobadi/fix-publish-coordinator
Fix publish coordinator
2 parents 89e2ee3 + e0d47f8 commit 6bfe204

File tree

60 files changed

+1985
-2749
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1985
-2749
lines changed

CLAUDE.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,14 @@ The tool supports multiple build configurations:
136136
- This is a known issue with SwiftData in test environments and doesn't affect functionality
137137
- Tests must be run using `xcodebuild` instead of `swift test` due to SwiftData compatibility requirements
138138

139+
## Test Development Guidelines
140+
141+
### Data Type Verification
142+
- **Never guess at implementation**: When encountering a data type you haven't read into memory, always look up the file first
143+
- **Read before using**: Use the Read tool to examine struct/class/enum definitions before using them in tests
144+
- **Verify initializers**: Check actual initializer signatures rather than assuming parameters
145+
- **Example**: Before creating a `BuildConfig`, read the file to see its actual properties and initializer
146+
139147
## Code Style Preferences
140148

141149
### Extension Organization
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,5 @@ public enum NnexError: Error {
3232

3333
case missingExecutable
3434
case selectionRequired
35+
case uncommittedChanges
3536
}
File renamed without changes.

Sources/NnexKit/Shared/HomebrewFormulaStoreAdapter.swift renamed to Sources/NnexKit/Formula/HomebrewFormulaStoreAdapter.swift

File renamed without changes.

Sources/NnexKit/Formula/PublishUtilities.swift

Lines changed: 0 additions & 108 deletions
This file was deleted.

Sources/NnexKit/Version/AutoVersionHandler.swift renamed to Sources/NnexKit/Publishing/AutoVersionHandler.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public extension AutoVersionHandler {
2929
}
3030

3131
let fileContent = try fileSystem.readFile(at: mainFile)
32+
3233
return extractVersionFromContent(fileContent)
3334
}
3435

Sources/NnexKit/Formula/FormulaContentGenerator.swift renamed to Sources/NnexKit/Publishing/FormulaContentGenerator.swift

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77

88
public enum FormulaContentGenerator {
99
public static func makeFormulaFileContent(
10-
name: String,
10+
formulaName: String,
11+
installName: String,
1112
details: String,
1213
homepage: String,
1314
license: String,
@@ -17,7 +18,7 @@ public enum FormulaContentGenerator {
1718
) -> String {
1819
let sanitizedVersion = sanitizeVersion(version)
1920
return """
20-
class \(FormulaNameSanitizer.sanitizeFormulaName(name)) < Formula
21+
class \(FormulaNameSanitizer.sanitizeFormulaName(formulaName)) < Formula
2122
desc "\(details)"
2223
homepage "\(homepage)"
2324
url "\(assetURL)"
@@ -26,18 +27,19 @@ public enum FormulaContentGenerator {
2627
license "\(license)"
2728
2829
def install
29-
bin.install "\(name)"
30+
bin.install "\(installName)"
3031
end
3132
3233
test do
33-
system "#{bin}/\(name)", "--help"
34+
system "#{bin}/\(installName)", "--help"
3435
end
3536
end
3637
"""
3738
}
3839

3940
public static func makeFormulaFileContent(
40-
name: String,
41+
formulaName: String,
42+
installName: String,
4143
details: String,
4244
homepage: String,
4345
license: String,
@@ -53,7 +55,7 @@ public enum FormulaContentGenerator {
5355
if hasArm && hasIntel {
5456
let sanitizedVersion = sanitizeVersion(version)
5557
return """
56-
class \(FormulaNameSanitizer.sanitizeFormulaName(name)) < Formula
58+
class \(FormulaNameSanitizer.sanitizeFormulaName(formulaName)) < Formula
5759
desc "\(details)"
5860
homepage "\(homepage)"
5961
version "\(sanitizedVersion)"
@@ -72,17 +74,18 @@ public enum FormulaContentGenerator {
7274
end
7375
7476
def install
75-
bin.install "\(name)"
77+
bin.install "\(installName)"
7678
end
7779
7880
test do
79-
system "#{bin}/\(name)", "--help"
81+
system "#{bin}/\(installName)", "--help"
8082
end
8183
end
8284
"""
8385
} else if hasArm {
8486
return makeFormulaFileContent(
85-
name: name,
87+
formulaName: formulaName,
88+
installName: installName,
8689
details: details,
8790
homepage: homepage,
8891
license: license,
@@ -92,7 +95,8 @@ public enum FormulaContentGenerator {
9295
)
9396
} else if hasIntel {
9497
return makeFormulaFileContent(
95-
name: name,
98+
formulaName: formulaName,
99+
installName: installName,
96100
details: details,
97101
homepage: homepage,
98102
license: license,
@@ -102,7 +106,8 @@ public enum FormulaContentGenerator {
102106
)
103107
} else {
104108
return makeFormulaFileContent(
105-
name: name,
109+
formulaName: formulaName,
110+
installName: installName,
106111
details: details,
107112
homepage: homepage,
108113
license: license,
@@ -118,6 +123,6 @@ public enum FormulaContentGenerator {
118123
// MARK: - Private Methods
119124
private extension FormulaContentGenerator {
120125
static func sanitizeVersion(_ version: String) -> String {
121-
version.hasPrefix("v") ? String(version.dropFirst()) : version
126+
return version.hasPrefix("v") ? String(version.dropFirst()) : version
122127
}
123128
}
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)