Skip to content

refactor: extract plist generation into standalone PlistGenerator - #43

Merged
malpern merged 1 commit into
masterfrom
refactor/extract-plist-generator
Nov 25, 2025
Merged

refactor: extract plist generation into standalone PlistGenerator#43
malpern merged 1 commit into
masterfrom
refactor/extract-plist-generator

Conversation

@malpern

@malpern malpern commented Nov 25, 2025

Copy link
Copy Markdown
Owner

Summary

  • Extract all plist generation functions from LaunchDaemonInstaller.swift into a new standalone PlistGenerator struct
  • Create pure, stateless static methods for generating launchd plist XML content
  • Include all service IDs and executable paths as constants in the new file

Changes

New file Sources/KeyPathAppKit/InstallationWizard/Core/PlistGenerator.swift containing:

  • 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

Test plan

  • swift build succeeds with no errors
  • swift test passes (all 60 Swift Testing tests pass)
  • New file compiles independently
  • No changes to existing files (extraction-only)

Note

Adds a new PlistGenerator with pure static methods to generate launchd plists for Kanata, VHID daemon/manager, and log rotation, plus a Kanata args builder.

  • Core (Installation Wizard):
    • New Sources/KeyPathAppKit/InstallationWizard/Core/PlistGenerator.swift:
      • Defines constants for service IDs and executable paths (kanata, vhiddaemon, vhidmanager, logrotate).
      • Adds static generators: generateKanataPlist, generateVHIDDaemonPlist, generateVHIDManagerPlist, generateLogRotationPlist.
      • Adds helper buildKanataPlistArguments for Kanata program args.
      • Produces complete launchd plist XML strings with logging, run behavior, and user/group settings.

Written by Cursor Bugbot for commit 2899071. This will update automatically on new commits. Configure here.

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.
@malpern
malpern merged commit 94fb8b7 into master Nov 25, 2025
2 of 3 checks passed
@malpern
malpern deleted the refactor/extract-plist-generator branch November 25, 2025 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant