v1.2.3 release: remove ShoeGaze CLI scaffolding (ShoeGaze now standalone)
This commit is contained in:
@@ -30,20 +30,6 @@ public enum ProjectTemplate: String, CaseIterable, Equatable {
|
||||
/// AUv3 host `.app` + `aumu` plugin extension wrapping a Lyrebird synth.
|
||||
/// Generates a full `<name>.xcodeproj` with two targets and entitlements files.
|
||||
case auv3 = "auv3"
|
||||
/// macOS guitar-pedalboard starter app built on `LyrebirdShoeGaze`.
|
||||
/// Generates a full `<name>.xcodeproj` with a SwiftUI `@main App` entry
|
||||
/// point, an `@Observable` app model wiring `CoreAudioDriver` + `ShoeGaze`,
|
||||
/// a root `ShoeGazeView`, and an **Audio ▸ Mute ⌘M** menu command.
|
||||
/// Requires `--shoegaze-path` (or a published ShoeGaze URL) in addition to
|
||||
/// the normal `--lyrebird-path`.
|
||||
case shoegaze = "shoegaze"
|
||||
/// iOS guitar-pedalboard starter app built on `LyrebirdShoeGaze`.
|
||||
/// Generates a full `<name>.xcodeproj` with a SwiftUI `@main App` entry
|
||||
/// point, an `@Observable` app model wiring `iOSAudioDriver` +
|
||||
/// `AVAudioSession` + `ShoeGaze`, and a root `ShoeGazeView`.
|
||||
/// Requires `--shoegaze-path` (or a published ShoeGaze URL) in addition to
|
||||
/// the normal `--lyrebird-path`.
|
||||
case shoegazeIOS = "shoegaze-ios"
|
||||
|
||||
/// Case-insensitive init from a raw string. Accepts hyphen-free aliases too.
|
||||
public init?(string: String) {
|
||||
@@ -60,10 +46,6 @@ public enum ProjectTemplate: String, CaseIterable, Equatable {
|
||||
self = .iosUI
|
||||
case "auv3", "au-v3", "au_v3":
|
||||
self = .auv3
|
||||
case "shoegaze", "shoe-gaze", "shoe_gaze":
|
||||
self = .shoegaze
|
||||
case "shoegaze-ios", "shoegazeios", "shoegaze_ios":
|
||||
self = .shoegazeIOS
|
||||
default: return nil
|
||||
}
|
||||
}
|
||||
@@ -77,7 +59,7 @@ public enum ProjectTemplate: String, CaseIterable, Equatable {
|
||||
public var shipsXcodeProject: Bool {
|
||||
switch self {
|
||||
case .basic, .demo, .uiDemo, .nrt, .score: return false
|
||||
case .shoegaze, .macosUIXcode, .iosUI, .auv3, .shoegazeIOS: return true
|
||||
case .macosUIXcode, .iosUI, .auv3: return true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -171,16 +153,12 @@ public enum ProjectScaffolder {
|
||||
/// *before* calling this (see `LyrebirdCLI.runNew`), so default
|
||||
/// scaffolds track current `main`; direct library callers get the
|
||||
/// documented `nil` → remote behaviour.
|
||||
/// - shoegazePath: Absolute path to a local ShoeGaze checkout. Only
|
||||
/// consumed by the `shoegaze` template. `nil` → emit a remote-URL
|
||||
/// placeholder in the generated `Package.swift`.
|
||||
/// - Throws: `ProjectScaffolder.Error` on name validation failure or file system errors.
|
||||
public static func scaffold(
|
||||
name: String,
|
||||
template: ProjectTemplate = .basic,
|
||||
in parentDirectory: String = FileManager.default.currentDirectoryPath,
|
||||
lyrebirdPath: String? = nil,
|
||||
shoegazePath: String? = nil
|
||||
lyrebirdPath: String? = nil
|
||||
) throws {
|
||||
try validateName(name)
|
||||
|
||||
@@ -205,14 +183,12 @@ public enum ProjectScaffolder {
|
||||
template: template,
|
||||
projectRoot: projectRoot,
|
||||
lyrebirdPath: lyrebirdPath,
|
||||
shoegazePath: shoegazePath,
|
||||
fm: fm)
|
||||
} else {
|
||||
try scaffoldSwiftPackage(name: name,
|
||||
template: template,
|
||||
projectRoot: projectRoot,
|
||||
lyrebirdPath: lyrebirdPath,
|
||||
shoegazePath: shoegazePath,
|
||||
fm: fm)
|
||||
}
|
||||
}
|
||||
@@ -224,7 +200,6 @@ public enum ProjectScaffolder {
|
||||
template: ProjectTemplate,
|
||||
projectRoot: String,
|
||||
lyrebirdPath: String?,
|
||||
shoegazePath: String? = nil,
|
||||
fm: FileManager
|
||||
) throws {
|
||||
let sourcesDir: String = (projectRoot as NSString)
|
||||
@@ -252,8 +227,7 @@ public enum ProjectScaffolder {
|
||||
packageManifest(
|
||||
name: name,
|
||||
template: template,
|
||||
lyrebirdPath: lyrebirdPath,
|
||||
shoegazePath: shoegazePath
|
||||
lyrebirdPath: lyrebirdPath
|
||||
)
|
||||
),
|
||||
(
|
||||
@@ -294,7 +268,6 @@ public enum ProjectScaffolder {
|
||||
template: ProjectTemplate,
|
||||
projectRoot: String,
|
||||
lyrebirdPath: String?,
|
||||
shoegazePath: String? = nil,
|
||||
fm: FileManager
|
||||
) throws {
|
||||
// Every xcode-bearing template ships an `<name>.xcworkspace` that
|
||||
@@ -321,10 +294,6 @@ public enum ProjectScaffolder {
|
||||
fm: fm, projectRoot: projectRoot)
|
||||
|
||||
switch template {
|
||||
case .shoegaze:
|
||||
try writeShoeGazeMacOSFiles(name: name, projectRoot: projectRoot,
|
||||
lyrebirdPath: lyrebirdPath,
|
||||
shoegazePath: shoegazePath, fm: fm)
|
||||
case .macosUIXcode:
|
||||
try writeMacOSUIXcodeFiles(name: name, projectRoot: projectRoot,
|
||||
lyrebirdPath: lyrebirdPath, fm: fm)
|
||||
@@ -334,10 +303,6 @@ public enum ProjectScaffolder {
|
||||
case .auv3:
|
||||
try writeAUv3Files(name: name, projectRoot: projectRoot,
|
||||
lyrebirdPath: lyrebirdPath, fm: fm)
|
||||
case .shoegazeIOS:
|
||||
try writeShoeGazeIOSFiles(name: name, projectRoot: projectRoot,
|
||||
lyrebirdPath: lyrebirdPath,
|
||||
shoegazePath: shoegazePath, fm: fm)
|
||||
case .basic, .demo, .uiDemo, .nrt, .score:
|
||||
// Unreachable — shipsXcodeProject filters these out at dispatch.
|
||||
try? fm.removeItem(atPath: projectRoot)
|
||||
@@ -399,14 +364,10 @@ public enum ProjectScaffolder {
|
||||
/// nil, falls back to the published Git URL (``lyrebirdPackageURL``).
|
||||
/// Used by `lyrebird new --lyrebird-path` for users who don't yet
|
||||
/// have access to the public repository.
|
||||
/// - shoegazePath: When non-nil and template is `.shoegaze`, the
|
||||
/// ShoeGaze package is declared as a local SPM dependency at this
|
||||
/// absolute path. When nil, a remote-URL placeholder is emitted.
|
||||
public static func packageManifest(
|
||||
name: String,
|
||||
template: ProjectTemplate = .basic,
|
||||
lyrebirdPath: String? = nil,
|
||||
shoegazePath: String? = nil
|
||||
lyrebirdPath: String? = nil
|
||||
) -> String {
|
||||
// byName resolves only when the product name matches the package
|
||||
// name (`Lyrebird`). Sibling products (`LyrebirdUI`) need the
|
||||
@@ -418,7 +379,7 @@ public enum ProjectScaffolder {
|
||||
targetDeps = #""Lyrebird""#
|
||||
case .uiDemo:
|
||||
targetDeps = #""Lyrebird", .product(name: "LyrebirdUI", package: "Lyrebird")"#
|
||||
case .shoegaze, .macosUIXcode, .iosUI, .auv3, .shoegazeIOS:
|
||||
case .macosUIXcode, .iosUI, .auv3:
|
||||
// Xcode-bearing templates don't emit a `Package.swift` — dispatch
|
||||
// never reaches this function for them. Defensive fallthrough.
|
||||
targetDeps = #""Lyrebird", .product(name: "LyrebirdUI", package: "Lyrebird")"#
|
||||
@@ -476,7 +437,7 @@ public enum ProjectScaffolder {
|
||||
case .uiDemo: return mainSwiftUIDemo(name: name)
|
||||
case .nrt: return mainSwiftNRT(name: name)
|
||||
case .score: return mainSwiftScore(name: name)
|
||||
case .shoegaze, .macosUIXcode, .iosUI, .auv3, .shoegazeIOS:
|
||||
case .macosUIXcode, .iosUI, .auv3:
|
||||
// Xcode-bearing templates don't emit a `main.swift` under
|
||||
// `Sources/<name>/`. Dispatch never reaches this function for
|
||||
// them. Defensive fallthrough to the basic skeleton.
|
||||
@@ -806,98 +767,6 @@ public enum ProjectScaffolder {
|
||||
"""
|
||||
}
|
||||
|
||||
// MARK: shoegaze
|
||||
|
||||
private static func mainSwiftShoegaze(name: String) -> String {
|
||||
"""
|
||||
// \(name) — ShoeGaze guitar pedalboard
|
||||
import AppKit
|
||||
|
||||
// Program entry runs on the main thread; assert main-actor isolation for the
|
||||
// AppKit bootstrap rather than hopping asynchronously.
|
||||
MainActor.assumeIsolated {
|
||||
let app: NSApplication = NSApplication.shared
|
||||
let delegate: AppDelegate = AppDelegate()
|
||||
app.setActivationPolicy(.regular)
|
||||
app.delegate = delegate
|
||||
app.activate(ignoringOtherApps: true)
|
||||
app.run()
|
||||
}
|
||||
"""
|
||||
}
|
||||
|
||||
/// `AppDelegate.swift` content for a shoegaze project.
|
||||
public static func shoegazeAppDelegateSwift(name: String) -> String {
|
||||
let blockSize: Int = scaffoldDefaultBlockSize
|
||||
let sampleRate: Double = 48_000.0
|
||||
let outputChannels: Int = scaffoldDefaultOutputChannels
|
||||
let inputChannels: Int = 0
|
||||
let windowWidth: Int = 980
|
||||
let windowHeight: Int = 520
|
||||
return """
|
||||
import AppKit
|
||||
import LyrebirdSynth
|
||||
import LyrebirdUI
|
||||
import LyrebirdShoeGaze
|
||||
import LyrebirdShoeGazeUI
|
||||
|
||||
/// Application delegate for \(name).
|
||||
///
|
||||
/// Builds a `SynthesisEngine`, a `ShoeGaze` manager, and a default board of
|
||||
/// four pedals (Overdrive → Delay → Reverb → Modulation) fed by the built-in
|
||||
/// test loop, then opens a `LyrebirdWindow` hosting `ShoeGazeView`.
|
||||
@MainActor
|
||||
final class AppDelegate: NSObject, NSApplicationDelegate {
|
||||
|
||||
private let engine: SynthesisEngine
|
||||
private let shoeGaze: ShoeGaze
|
||||
private let window: LyrebirdWindow
|
||||
|
||||
override init() {
|
||||
let engine: SynthesisEngine = SynthesisEngine(
|
||||
blockSize: \(blockSize),
|
||||
sampleRate: \(sampleRate),
|
||||
numOutputChannels: \(outputChannels),
|
||||
numInputChannels: \(inputChannels),
|
||||
driver: CoreAudioDriver()
|
||||
)
|
||||
self.engine = engine
|
||||
self.shoeGaze = ShoeGaze(engine: engine)
|
||||
self.window = LyrebirdWindow(
|
||||
title: "\(name)",
|
||||
width: \(windowWidth),
|
||||
height: \(windowHeight)
|
||||
)
|
||||
super.init()
|
||||
}
|
||||
|
||||
func applicationDidFinishLaunching(_ notification: Notification) {
|
||||
do {
|
||||
let board: PedalBoard = try shoeGaze.addBoard()
|
||||
try board.add(OverdrivePedal())
|
||||
try board.add(DelayPedal())
|
||||
try board.add(ReverbPedal())
|
||||
try board.add(ModulationPedal())
|
||||
try shoeGaze.finalizeBoard(board)
|
||||
} catch {
|
||||
print("[\(name)] board build failed: \\(error)")
|
||||
}
|
||||
window.open {
|
||||
ShoeGazeView(shoeGaze: shoeGaze)
|
||||
}
|
||||
}
|
||||
|
||||
func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
|
||||
true
|
||||
}
|
||||
|
||||
func applicationWillTerminate(_ notification: Notification) {
|
||||
engine.stop()
|
||||
}
|
||||
}
|
||||
"""
|
||||
}
|
||||
|
||||
// MARK: - ui-demo additional files
|
||||
|
||||
/// `AppDelegate.swift` content for a ui-demo project.
|
||||
|
||||
Reference in New Issue
Block a user