before the great git rework

This commit is contained in:
2026-10-30 11:27:44 +01:00
parent 9bdda896af
commit b9c03a7637
45 changed files with 70 additions and 562 deletions
@@ -1,28 +0,0 @@
import Foundation
public protocol NotesServicing: Sendable {
/// The note's text; "" when the project has none yet.
func read() async -> String
func write(_ text: String) async throws
}
/// The note is a plain `.notes.txt` in the project root, not JSON and not in `.helder/`,
/// so it stays readable and editable outside Helder.
public struct NotesService: NotesServicing {
public static let fileName = ".notes.txt"
public let root: URL
public init(root: URL) {
self.root = root
}
private var url: URL { root.appendingPathComponent(Self.fileName) }
public func read() async -> String {
(try? String(contentsOf: url, encoding: .utf8)) ?? ""
}
public func write(_ text: String) async throws {
try Data(text.utf8).write(to: url, options: .atomic)
}
}