From a96efee4cf5415831933656c23ca7a1ef8f00e3b Mon Sep 17 00:00:00 2001 From: Tommaso Negri Date: Fri, 10 Jul 2026 09:59:02 +0200 Subject: [PATCH] initial commit --- .gitignore | 8 ++++++++ AGENTS.md | 7 +++++++ LICENSE | 21 +++++++++++++++++++++ Package.resolved | 24 ++++++++++++++++++++++++ Package.swift | 31 +++++++++++++++++++++++++++++++ Sources/phbar/phbar.swift | 14 ++++++++++++++ Tests/phbarTests/phbarTests.swift | 9 +++++++++ 7 files changed, 114 insertions(+) create mode 100644 .gitignore create mode 100644 AGENTS.md create mode 100644 LICENSE create mode 100644 Package.resolved create mode 100644 Package.swift create mode 100644 Sources/phbar/phbar.swift create mode 100644 Tests/phbarTests/phbarTests.swift diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0023a53 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +.DS_Store +/.build +/Packages +xcuserdata/ +DerivedData/ +.swiftpm/configuration/registries.json +.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata +.netrc diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..e58c1fb --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,7 @@ +# Agents + +- use tabs instead of spaces +- avoid duplicate code +- follow MVC best practices +- do not stage files, make commits, or push request FOR ANY REASON! +- keep the test suite up-to-date and add new relevant tests diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..5002dae --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Tommaso Negri + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Package.resolved b/Package.resolved new file mode 100644 index 0000000..aa08147 --- /dev/null +++ b/Package.resolved @@ -0,0 +1,24 @@ +{ + "originHash" : "4cb94cb88d628634d225147970404de3e707bc855f64606d3b27ce32f2ec157c", + "pins" : [ + { + "identity" : "swift-argument-parser", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-argument-parser.git", + "state" : { + "revision" : "6a52f3251125d74daf04fcbd5e6f08a75d074382", + "version" : "1.8.2" + } + }, + { + "identity" : "swift-toml", + "kind" : "remoteSourceControl", + "location" : "https://github.com/mattt/swift-toml.git", + "state" : { + "revision" : "827506c90475e82d5a7f191f950fb3025cbdc0d6", + "version" : "2.0.0" + } + } + ], + "version" : 3 +} diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..3a81337 --- /dev/null +++ b/Package.swift @@ -0,0 +1,31 @@ +// swift-tools-version: 6.3 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "phbar", + platforms: [ + .macOS(.v15) + ], + dependencies: [ + .package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.2.0"), + .package(url: "https://github.com/mattt/swift-toml.git", from: "2.0.0"), + ], + targets: [ + // Targets are the basic building blocks of a package, defining a module or a test suite. + // Targets can depend on other targets in this package and products from dependencies. + .executableTarget( + name: "phbar", + dependencies: [ + .product(name: "ArgumentParser", package: "swift-argument-parser"), + .product(name: "TOML", package: "swift-toml"), + ] + ), + .testTarget( + name: "phbarTests", + dependencies: ["phbar"] + ), + ], + swiftLanguageModes: [.v6] +) diff --git a/Sources/phbar/phbar.swift b/Sources/phbar/phbar.swift new file mode 100644 index 0000000..e7ed9be --- /dev/null +++ b/Sources/phbar/phbar.swift @@ -0,0 +1,14 @@ +// The Swift Programming Language +// https://docs.swift.org/swift-book +// +// Swift Argument Parser +// https://swiftpackageindex.com/apple/swift-argument-parser/documentation + +import ArgumentParser + +@main +struct phbar: ParsableCommand { + mutating func run() throws { + print("Hello, world!") + } +} diff --git a/Tests/phbarTests/phbarTests.swift b/Tests/phbarTests/phbarTests.swift new file mode 100644 index 0000000..a93123c --- /dev/null +++ b/Tests/phbarTests/phbarTests.swift @@ -0,0 +1,9 @@ +import Testing + +@testable import phbar + +@Test func example() async throws { + // Write your test here and use APIs like `#expect(...)` to check expected conditions. + // Swift Testing Documentation + // https://developer.apple.com/documentation/testing +}