Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
62e08b6
organize files
nikolainobadi Dec 12, 2025
1a64f3c
minor reformatting
nikolainobadi Dec 12, 2025
65d6aa9
WIP -> add new PublishCoordinator
nikolainobadi Dec 12, 2025
9498a77
refactor(publish): separate formula name from install name in generator
nikolainobadi Dec 12, 2025
c2ec3f4
test: add distinct install name validation for formula generator
nikolainobadi Dec 12, 2025
3f00055
WIP -> add more functionality to PublishCoordinator
nikolainobadi Dec 13, 2025
8ac4607
WIP -> nearly done outlining responsibilities for Publish
nikolainobadi Dec 13, 2025
eed0c7c
WIP -> trying to deconstruct new PublishCoordinator
nikolainobadi Dec 13, 2025
29c984e
fully enabled PublishCoordinator -> still need to refactor for scalab…
nikolainobadi Dec 13, 2025
46c0369
feat(release): add GithubReleaseController to decouple release logic
nikolainobadi Dec 13, 2025
a68c771
feat(publish): add FormulaPublishController to decouple formula publi…
nikolainobadi Dec 13, 2025
05d586d
feat(publish): add ArtifactController to decouple artifact building l…
nikolainobadi Dec 13, 2025
95cc141
move old files to Old folder
nikolainobadi Dec 13, 2025
25551b3
refactor(publish): extract PublishCoordinator with delegate pattern
nikolainobadi Dec 13, 2025
cc97fc6
refactor(publish): reorganize publish models and adapters into subdir…
nikolainobadi Dec 13, 2025
2263e66
test(publish): add ArtifactController unit tests
nikolainobadi Dec 13, 2025
cb91c9a
test(publish): add GithubReleaseController unit tests
nikolainobadi Dec 13, 2025
0e3ccb5
test(publish): add FormulaPublishController unit tests
nikolainobadi Dec 13, 2025
40c8506
refactor(publish): remove old PublishCoordinator and manager implemen…
nikolainobadi Dec 13, 2025
a86ac98
test(publish): reorganize FormulaPublishController tests with MainAct…
nikolainobadi Dec 13, 2025
258da12
fix FormulaPublishControllerTests
nikolainobadi Dec 13, 2025
2602680
refactor(publish): simplify ArtifactController tests and extract dele…
nikolainobadi Dec 14, 2025
2bf4518
refactor(publish): extract version handling to VersionNumberController
nikolainobadi Dec 14, 2025
7c79d99
refactor(publish): extract version service to protocol dependency
nikolainobadi Dec 14, 2025
967f7ce
minor reformatting
nikolainobadi Dec 14, 2025
1aaf6fe
add emtpy test file for PublishCoordinatorTests
nikolainobadi Dec 14, 2025
cb3a76e
minor reformatting
nikolainobadi Dec 14, 2025
4a722bc
test(publish): add publish flow validation test
nikolainobadi Dec 14, 2025
6c6bfad
minor reformatting
nikolainobadi Dec 14, 2025
d364c28
add tests for PublishCoordinator
nikolainobadi Dec 14, 2025
3f57b61
delete unneeded tests
nikolainobadi Dec 14, 2025
b965cf3
add empty VersionNumberControllerTests
nikolainobadi Dec 14, 2025
4ebd7ed
remove unneeded dependency from ArtifactController
nikolainobadi Dec 14, 2025
0cb53cb
delete unneeded tests
nikolainobadi Dec 14, 2025
5ece208
remove shit tests for BuildController
nikolainobadi Dec 14, 2025
a8dcf0f
add tests for ArtifactController
nikolainobadi Dec 14, 2025
48da7f4
add unit tests for BuildController
nikolainobadi Dec 14, 2025
dad3410
add unit tests for GithubReleaseController
nikolainobadi Dec 14, 2025
bab8936
add unit tests for VersionNumberController
nikolainobadi Dec 14, 2025
b6af594
fix failing tests
nikolainobadi Dec 14, 2025
e6729c0
delete unneeded files
nikolainobadi Dec 14, 2025
e0d47f8
fix build tests
nikolainobadi Dec 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,14 @@ The tool supports multiple build configurations:
- This is a known issue with SwiftData in test environments and doesn't affect functionality
- Tests must be run using `xcodebuild` instead of `swift test` due to SwiftData compatibility requirements

## Test Development Guidelines

### Data Type Verification
- **Never guess at implementation**: When encountering a data type you haven't read into memory, always look up the file first
- **Read before using**: Use the Read tool to examine struct/class/enum definitions before using them in tests
- **Verify initializers**: Check actual initializer signatures rather than assuming parameters
- **Example**: Before creating a `BuildConfig`, read the file to see its actual properties and initializer

## Code Style Preferences

### Extension Organization
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ public enum NnexError: Error {

case missingExecutable
case selectionRequired
case uncommittedChanges
}
108 changes: 0 additions & 108 deletions Sources/NnexKit/Formula/PublishUtilities.swift

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public extension AutoVersionHandler {
}

let fileContent = try fileSystem.readFile(at: mainFile)

return extractVersionFromContent(fileContent)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

public enum FormulaContentGenerator {
public static func makeFormulaFileContent(
name: String,
formulaName: String,
installName: String,
details: String,
homepage: String,
license: String,
Expand All @@ -17,7 +18,7 @@ public enum FormulaContentGenerator {
) -> String {
let sanitizedVersion = sanitizeVersion(version)
return """
class \(FormulaNameSanitizer.sanitizeFormulaName(name)) < Formula
class \(FormulaNameSanitizer.sanitizeFormulaName(formulaName)) < Formula
desc "\(details)"
homepage "\(homepage)"
url "\(assetURL)"
Expand All @@ -26,18 +27,19 @@ public enum FormulaContentGenerator {
license "\(license)"

def install
bin.install "\(name)"
bin.install "\(installName)"
end

test do
system "#{bin}/\(name)", "--help"
system "#{bin}/\(installName)", "--help"
end
end
"""
}

public static func makeFormulaFileContent(
name: String,
formulaName: String,
installName: String,
details: String,
homepage: String,
license: String,
Expand All @@ -53,7 +55,7 @@ public enum FormulaContentGenerator {
if hasArm && hasIntel {
let sanitizedVersion = sanitizeVersion(version)
return """
class \(FormulaNameSanitizer.sanitizeFormulaName(name)) < Formula
class \(FormulaNameSanitizer.sanitizeFormulaName(formulaName)) < Formula
desc "\(details)"
homepage "\(homepage)"
version "\(sanitizedVersion)"
Expand All @@ -72,17 +74,18 @@ public enum FormulaContentGenerator {
end

def install
bin.install "\(name)"
bin.install "\(installName)"
end

test do
system "#{bin}/\(name)", "--help"
system "#{bin}/\(installName)", "--help"
end
end
"""
} else if hasArm {
return makeFormulaFileContent(
name: name,
formulaName: formulaName,
installName: installName,
details: details,
homepage: homepage,
license: license,
Expand All @@ -92,7 +95,8 @@ public enum FormulaContentGenerator {
)
} else if hasIntel {
return makeFormulaFileContent(
name: name,
formulaName: formulaName,
installName: installName,
details: details,
homepage: homepage,
license: license,
Expand All @@ -102,7 +106,8 @@ public enum FormulaContentGenerator {
)
} else {
return makeFormulaFileContent(
name: name,
formulaName: formulaName,
installName: installName,
details: details,
homepage: homepage,
license: license,
Expand All @@ -118,6 +123,6 @@ public enum FormulaContentGenerator {
// MARK: - Private Methods
private extension FormulaContentGenerator {
static func sanitizeVersion(_ version: String) -> String {
version.hasPrefix("v") ? String(version.dropFirst()) : version
return version.hasPrefix("v") ? String(version.dropFirst()) : version
}
}
62 changes: 0 additions & 62 deletions Sources/NnexKit/Releasing/ReleaseStore.swift

This file was deleted.

6 changes: 3 additions & 3 deletions Sources/NnexKit/SwiftData/Mappers/HomebrewTapMapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
// Created by Nikolai Nobadi on 12/11/25.
//

enum HomebrewTapMapper {
static func toDomain(_ tap: SwiftDataHomebrewTap) -> HomebrewTap {
public enum HomebrewTapMapper {
public static func toDomain(_ tap: SwiftDataHomebrewTap) -> HomebrewTap {
let formulas = tap.formulas.map({ swiftDataFormula in
var formula = HomebrewFormulaMapper.toDomain(swiftDataFormula)
formula.tapLocalPath = tap.localPath
Expand All @@ -16,7 +16,7 @@ enum HomebrewTapMapper {
return .init(name: tap.name, localPath: tap.localPath, remotePath: tap.remotePath, formulas: formulas)
}

static func toSwiftData(_ tap: HomebrewTap) -> SwiftDataHomebrewTap {
public static func toSwiftData(_ tap: HomebrewTap) -> SwiftDataHomebrewTap {
return .init(name: tap.name, localPath: tap.localPath, remotePath: tap.remotePath)
}
}
1 change: 0 additions & 1 deletion Sources/NnexSharedTestHelpers/MockGitHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,3 @@ extension MockGitHandler: GitHandler {
return urls
}
}

Loading