Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/native.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
name: Native macOS

on:
push:
branches:
- '**'
paths:
- 'apps/native-macos/**'
- '.github/workflows/native.yml'

permissions:
contents: read

jobs:
lint:
runs-on: macos-26
defaults:
run:
working-directory: apps/native-macos
steps:
- uses: actions/checkout@v7
- name: Select Xcode 26
run: sudo xcode-select -s /Applications/Xcode_26.app 2>/dev/null || sudo xcode-select -s /Applications/Xcode.app
- name: SwiftFormat (lint)
run: swift package --allow-writing-to-package-directory swiftformat --lint
- name: SwiftLint
run: swift package --allow-writing-to-package-directory swiftlint --strict
build-and-test:
runs-on: macos-26
defaults:
run:
working-directory: apps/native-macos
steps:
- uses: actions/checkout@v7
- name: Select Xcode 26
run: sudo xcode-select -s /Applications/Xcode_26.app 2>/dev/null || sudo xcode-select -s /Applications/Xcode.app
- name: swift build
run: swift build
- name: swift test
run: swift test
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -175,3 +175,8 @@ docs/public/rustdoc/

test-results/**
playwright/screenshots/**

# Swift Package Manager build output
apps/native-macos/.build/
apps/native-macos/.swiftpm/
apps/native-macos/*.xcodeproj
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co

MC-Vector is a cross-platform desktop app (Tauri v2 + React 19 + TypeScript) for Minecraft server management. It handles server lifecycle, real-time monitoring, plugin/mod browsing (Modrinth, Hangar, SpigotMC), file editing (Monaco Editor), backups, Java version management, and Ngrok integration.

A macOS Tahoe (26)+ native app (Swift 6 / SwiftUI / AppKit) is planned as an independent reimplementation — not a shared-core port. See `spec/native-macos-requirements.md` for the full rationale.
A macOS Tahoe (26)+ native app (Swift 6 / SwiftUI / AppKit) is planned as an independent reimplementation — not a shared-core port. See `spec/native-macos-requirements.md` for the full rationale. The SwiftPM package lives under `apps/native-macos/` — see `apps/native-macos/README.md` for build/lint commands.

After any refactor: run `pnpm build` and confirm it succeeds before finishing.

Expand Down
7 changes: 7 additions & 0 deletions apps/native-macos/.swiftformat
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
--swiftversion 6.2
--indent 4
--maxwidth 120
--self insert
--importgrouping testable-last
--exclude .build
--disable swiftTestingTestCaseNames
14 changes: 14 additions & 0 deletions apps/native-macos/.swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
strict: true
reporter: "xcode"

excluded:
- .build

opt_in_rules:
- empty_count
- explicit_init
- fatal_error_message
- force_unwrapping

disabled_rules:
- todo
105 changes: 105 additions & 0 deletions apps/native-macos/Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions apps/native-macos/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// swift-tools-version:6.2
import PackageDescription

let package = Package(
name: "Native",
platforms: [.macOS(.v26)],
products: [
.library(name: "Core", targets: ["Core"])
],
dependencies: [
.package(url: "https://github.com/nicklockwood/SwiftFormat", from: "0.62.1"),
.package(url: "https://github.com/realm/SwiftLint", from: "0.65.0")
],
targets: [
.executableTarget(
name: "App",
dependencies: ["Core"],
plugins: [
.plugin(name: "SwiftLintBuildToolPlugin", package: "SwiftLint")
]
),
.target(
name: "Core",
plugins: [
.plugin(name: "SwiftLintBuildToolPlugin", package: "SwiftLint")
]
),
.testTarget(
name: "CoreTests",
dependencies: ["Core"],
plugins: [
.plugin(name: "SwiftLintBuildToolPlugin", package: "SwiftLint")
]
)
]
)
44 changes: 44 additions & 0 deletions apps/native-macos/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# MC-Vector Native (macOS)

Independent Swift/SwiftUI reimplementation of MC-Vector for macOS Tahoe (26)+.
See `spec/native-macos-requirements.md` for why this isn't a shared-core port,
and `spec/phase-tasks.md` for the phase-by-phase task breakdown.

No `.xcodeproj` — this is a plain SwiftPM package. `App` is a thin
`@main` entry point; `Core` holds the actual views/logic (this split is what
lets `#Preview` work without `ENABLE_DEBUG_DYLIB`, which can only be set via
an `.xcodeproj`).

## Requirements

- macOS 26 (Tahoe)+
- Xcode 26+ / Swift 6.2+

## Commands

Run from `apps/native-macos/`:

```bash
swift build # build App + Core
swift test # run CoreTests (Swift Testing)
```

Format and lint are exposed as SwiftPM plugins:

```bash
# SwiftFormat (command plugin — no build-tool plugin exists upstream)
swift package --allow-writing-to-package-directory swiftformat # write
swift package --allow-writing-to-package-directory swiftformat --lint # check only

# SwiftLint (build-tool plugin — runs automatically as part of `swift build`/`swift test`)
swift package --allow-writing-to-package-directory swiftlint --fix # autocorrect
```

`lefthook` runs both automatically on commit for files under `apps/native-macos/**/*.swift`
(see the `lint-format-swift` job in the root `lefthook.yml`); it no-ops with a message if
`swift` isn't on `PATH` locally, since CI (`.github/workflows/native.yml`) is the enforcement
backstop either way.

## Opening in Xcode

Xcode 26 can open `Package.swift` directly — no separate project file needed.
8 changes: 8 additions & 0 deletions apps/native-macos/Sources/App/Main.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import Core

@main
struct Main {
static func main() {
print("MC-Vector Native starting…")
}
}
3 changes: 3 additions & 0 deletions apps/native-macos/Sources/Core/Core.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
public enum Core {
public static let version = "0.0.1"
}
15 changes: 15 additions & 0 deletions apps/native-macos/Sources/Core/RootView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import SwiftUI

public struct RootView: View {
public init() {}

public var body: some View {
Text("MC-Vector Native")
.font(.title)
.padding()
}
}

#Preview {
RootView()
}
7 changes: 7 additions & 0 deletions apps/native-macos/Tests/CoreTests/CoreTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Testing
@testable import Core

@Test("Core.version is not empty")
func coreVersionIsSet() {
#expect(!Core.version.isEmpty)
}
11 changes: 11 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,14 @@ pre-commit:
glob: 'docs/src/**/*.{ts,mjs}'
run: pnpm --filter @mc-vector/docs check:fix
stage_fixed: true
lint-format-swift:
glob: 'apps/native-macos/**/*.swift'
run: |
if ! command -v swift >/dev/null 2>&1; then
echo "swift not found locally, skipping Swift format/lint (still enforced in CI)"
exit 0
fi
Comment on lines +18 to +21
cd apps/native-macos && \
swift package --allow-writing-to-package-directory swiftformat && \
swift package --allow-writing-to-package-directory swiftlint --fix
stage_fixed: true
Loading