refactor: extract plist generation into standalone PlistGenerator - #43
Merged
Conversation
Extract all plist generation functions from LaunchDaemonInstaller into a new PlistGenerator struct with pure, stateless static methods: - generateKanataPlist: Creates Kanata service launchd plist - generateVHIDDaemonPlist: Creates VHID daemon launchd plist - generateVHIDManagerPlist: Creates VHID manager launchd plist - generateLogRotationPlist: Creates log rotation service plist - buildKanataPlistArguments: Builds Kanata command-line arguments The new service contains all service IDs and executable paths as constants, making it self-contained for plist generation. This is an extraction-only change - LaunchDaemonInstaller is unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
LaunchDaemonInstaller.swiftinto a new standalonePlistGeneratorstructChanges
New file
Sources/KeyPathAppKit/InstallationWizard/Core/PlistGenerator.swiftcontaining:generateKanataPlist()- Creates Kanata service launchd plistgenerateVHIDDaemonPlist()- Creates VHID daemon launchd plistgenerateVHIDManagerPlist()- Creates VHID manager launchd plistgenerateLogRotationPlist()- Creates log rotation service plistbuildKanataPlistArguments()- Builds Kanata command-line argumentsTest plan
swift buildsucceeds with no errorsswift testpasses (all 60 Swift Testing tests pass)Note
Adds a new
PlistGeneratorwith pure static methods to generate launchd plists for Kanata, VHID daemon/manager, and log rotation, plus a Kanata args builder.Sources/KeyPathAppKit/InstallationWizard/Core/PlistGenerator.swift:kanata,vhiddaemon,vhidmanager,logrotate).generateKanataPlist,generateVHIDDaemonPlist,generateVHIDManagerPlist,generateLogRotationPlist.buildKanataPlistArgumentsfor Kanata program args.Written by Cursor Bugbot for commit 2899071. This will update automatically on new commits. Configure here.