diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.gitea/ISSUE_TEMPLATE/bug_report.yml similarity index 100% rename from .github/ISSUE_TEMPLATE/bug_report.yml rename to .gitea/ISSUE_TEMPLATE/bug_report.yml diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.gitea/ISSUE_TEMPLATE/feature_request.yml similarity index 100% rename from .github/ISSUE_TEMPLATE/feature_request.yml rename to .gitea/ISSUE_TEMPLATE/feature_request.yml diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.gitea/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from .github/PULL_REQUEST_TEMPLATE.md rename to .gitea/PULL_REQUEST_TEMPLATE.md diff --git a/.gitea/workflows/docs.yml b/.gitea/workflows/docs.yml new file mode 100644 index 0000000..523210e --- /dev/null +++ b/.gitea/workflows/docs.yml @@ -0,0 +1,34 @@ +name: Deploy Docs + +on: + push: + branches: ["main"] + +jobs: + publish: + runs-on: david-macbook + steps: + - uses: actions/checkout@v4 + - name: Build Docs + run: | + xcrun xcodebuild docbuild \ + -scheme TermKitBackend \ + -destination 'generic/platform=macOS' \ + -derivedDataPath "$PWD/.derivedData" \ + -skipPackagePluginValidation + xcrun docc process-archive transform-for-static-hosting \ + "$PWD/.derivedData/Build/Products/Debug/TermKitBackend.doccarchive" \ + --output-path "docs" \ + --hosting-base-path "/" + - name: Modify Docs + run: | + echo "

Please enable JavaScript to view the documentation here.

" > docs/index.html; + sed -i '' 's/,2px/,10px/g' docs/css/index.*.css + - name: Upload + uses: wangyucode/sftp-upload-action@v2.0.2 + with: + host: 'volans.uberspace.de' + username: 'akforum' + password: ${{ secrets.password }} + localDir: 'docs' + remoteDir: '/var/www/virtual/akforum/term-kit-backend.aparoksha.dev/' \ No newline at end of file diff --git a/.github/workflows/swiftlint.yml b/.gitea/workflows/swiftlint.yml similarity index 68% rename from .github/workflows/swiftlint.yml rename to .gitea/workflows/swiftlint.yml index 5348bdb..e1eb514 100644 --- a/.github/workflows/swiftlint.yml +++ b/.gitea/workflows/swiftlint.yml @@ -3,17 +3,17 @@ name: SwiftLint on: push: paths: - - '.github/workflows/swiftlint.yml' + - '.gitea/workflows/swiftlint.yml' - '.swiftlint.yml' - '**/*.swift' pull_request: paths: - - '.github/workflows/swiftlint.yml' + - '.gitea/workflows/swiftlint.yml' - '.swiftlint.yml' - '**/*.swift' workflow_dispatch: paths: - - '.github/workflows/swiftlint.yml' + - '.gitea/workflows/swiftlint.yml' - '.swiftlint.yml' - '**/*.swift' @@ -21,10 +21,10 @@ jobs: SwiftLint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - name: SwiftLint uses: norio-nomura/action-swiftlint@3.2.1 with: args: --strict env: - WORKING_DIRECTORY: Source + WORKING_DIRECTORY: Source \ No newline at end of file diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index 264572d..0000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Deploy Docs - -on: - push: - branches: ["main"] - -permissions: - contents: read - pages: write - id-token: write - -concurrency: - group: "pages" - cancel-in-progress: true - -jobs: - Deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: macos-15 - steps: - - uses: actions/checkout@v4 - - name: Build Docs - run: | - sed -i '' -n 'H;${x;s/^\n//;s/ .package.*$/ .package(url: "https:\/\/github.com\/swiftlang\/swift-docc-plugin", from: "1.3.0"),\n&/;p;}' Package.swift - swift package --allow-writing-to-directory ./docs \ - generate-documentation --target TermKitBackend --output-path ./docs \ - --transform-for-static-hosting --hosting-base-path TermKitBackend - - name: Modify Docs - run: | - echo "" > docs/index.html; - sed -i '' 's/,2px/,10px/g' docs/css/index.*.css - - name: Upload Artifact - uses: actions/upload-pages-artifact@v3 - with: - path: 'docs' - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 diff --git a/.swiftlint.yml b/.swiftlint.yml index 3de8ae8..3b0e654 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -94,12 +94,6 @@ disabled_rules: # Custom Rules custom_rules: - github_issue: - name: 'GitHub Issue' - regex: '//.(TODO|FIXME):.(?!.*(https://github\.com/david-swift/TermKitBackend/issues/\d))' - message: 'The related GitHub issue must be included in a TODO or FIXME.' - severity: warning - fatal_error: name: 'Fatal Error' regex: 'fatalError.*\(.*\)' diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 6ef81b6..0000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,34 +0,0 @@ -# Contributing - -Thank you very much for taking the time for contributing to this project. - -## Report a Bug -Just open a new issue on GitHub and describe the bug. It helps if your description is detailed. Thank you very much for your contribution! - -## Suggest a New Feature -Just open a new issue on GitHub and describe the idea. Thank you very much for your contribution! - -## Pull Requests -I am happy for every pull request, you do not have to follow these guidelines. However, it might help you to understand the project structure and make it easier for me to merge your pull request. Thank you very much for your contribution! - -### 1. Fork & Clone this Project -Start by clicking on the `Fork` button at the top of the page. Then, clone this repository to your computer. - -### 2. Open the Project -Open the project folder in GNOME Builder, Xcode or another IDE. - -### 3. Understand the Project Structure -- The `README.md` file contains a description of the app or package. -- The `LICENSE.md` contains an MIT license. -- `CONTRIBUTING.md` is this file. -- Directory `Icons` that contains SVG files for the images used in the app and guides. -- `Sources` contains the source code of the project as well as a test app. - -### 4. Edit the Code -Edit the code. If you add a new type, add documentation in the code. - -### 5. Commit to the Fork -Commit and push the fork. - -### 6. Pull Request -Open GitHub to submit a pull request. Thank you very much for your contribution! diff --git a/Package.swift b/Package.swift index fff1437..c412a98 100644 --- a/Package.swift +++ b/Package.swift @@ -19,13 +19,16 @@ let package = Package( ) ], dependencies: [ - .package(url: "https://github.com/AparokshaUI/Meta", branch: "main"), + .package(url: "https://git.aparoksha.dev/aparoksha/meta", branch: "main"), .package(url: "https://github.com/david-swift/TermKit", branch: "main") ], targets: [ .target( name: "TermKitBackend", - dependencies: ["TermKit", "Meta"] + dependencies: [ + "TermKit", + .product(name: "Meta", package: "meta") + ] ), .executableTarget( name: "TestApp", diff --git a/README.md b/README.md index 796ce55..0dc9510 100644 --- a/README.md +++ b/README.md @@ -3,16 +3,16 @@

- + Documentation ยท - - GitHub + + Code

-_TermKitBackend_ is a declarative framework allowing the creation of user interface for the terminal. It works on Linux and macOS thanks to the [TermKit project](https://github.com/migueldeicaza/TermKit). +_TermKitBackend_ is a declarative framework allowing the creation of user interfaces for the terminal. It works on Linux and macOS thanks to the [TermKit project](https://github.com/migueldeicaza/TermKit). ## Table of Contents @@ -22,21 +22,21 @@ _TermKitBackend_ is a declarative framework allowing the creation of user interf ## Overview -The declarative approach is based on the [Meta package](https://aparokshaui.github.io/Meta/) which can be found on [GitHub](https://github.com/AparokshaUI/Meta). +The declarative approach is based on the [Meta package](https://meta.aparoksha.dev/), browse the code [here](https://git.aparoksha.dev/aparoksha/meta). It is powered by [a fork of TermKit for Swift](https://github.com/david-swift/TermKit). -Detailed information about the declarative approach can be found in the [Meta docs](https://aparokshaui.github.io/meta/). Find the available widgets [here](https://david-swift.github.io/TermKitBackend). +Detailed information about the declarative approach can be found in the [Meta docs](https://meta.aparoksha.dev/). Find the available widgets [here](https://term-kit-backend.aparoksha.dev/). ## Usage -Follow the tutorial in the [docs](https://david-swift.github.io/TermKitBackend). +Follow the tutorial in the [docs](https://term-kit-backend.aparoksha.dev/). ## Thanks ### Dependencies - [TermKit](https://github.com/david-swift/TermKit) licensed under the [MIT License](https://github.com/david-swift/TermKit/blob/main/LICENSE) -- [Meta](https://github.com/AparokshaUI/Meta) licensed under the [MIT License](https://github.com/AparokshaUI/Meta/blob/main/LICENSE.md) +- [Meta](https://git.aparoksha.dev/aparoksha/meta) licensed under the [MIT License](https://git.aparoksha.dev/aparoksha/meta/src/branch/main/LICENSE.md) ### Other Thanks diff --git a/Sources/TermKitBackend/Model/TermKitApp.swift b/Sources/TermKitBackend/Model/TermKitApp.swift index 110f36e..e0abcde 100644 --- a/Sources/TermKitBackend/Model/TermKitApp.swift +++ b/Sources/TermKitBackend/Model/TermKitApp.swift @@ -1,5 +1,5 @@ // -// TermKitSceneElement.swift +// TermKitApp.swift // TermKitBackend // // Created by david-swift on 01.07.2024. @@ -13,17 +13,13 @@ public class TermKitApp: AppStorage { /// The scene element type of the TermKit backend. public typealias SceneElementType = TermKitSceneElement - /// The widget type of the TermKit backend. - public typealias WidgetType = TermKitWidget - /// The wrapper type of the TermKit backend. - public typealias WrapperType = VStack /// The app storage. public var storage: StandardAppStorage = .init() /// Initialize the app storage. /// - Parameter id: The identifier. - public required init(id: String) { } + public init() { } /// Execute the app. /// - Parameter setup: Set the scene elements up. diff --git a/Sources/TermKitBackend/TermKitBackend.docc/GettingStarted.md b/Sources/TermKitBackend/TermKitBackend.docc/GettingStarted.md index 098ec57..dafc9be 100644 --- a/Sources/TermKitBackend/TermKitBackend.docc/GettingStarted.md +++ b/Sources/TermKitBackend/TermKitBackend.docc/GettingStarted.md @@ -3,7 +3,7 @@ Learn how to use the TermKit backend. Knowledge about the Meta project is required. -Find more information [here](https://aparokshaui.github.io/Meta/). +Find more information [here](https://meta.aparoksha.dev). ## The App @@ -15,8 +15,7 @@ import TermKitBackend @main struct TestApp: App { - let id = "io.github.AparokshaUI.TestApp" - var app: TermKitApp! + let app = TermKitApp() var scene: Scene { Window { @@ -37,4 +36,4 @@ struct TestApp: App { ## Widgets All the available widgets can be found in the documentation. -Take a look at the [sample app](https://github.com/david-swift/TermKitBackend/blob/main/Sources/TestApp/TestApp.swift) for more help. +Take a look at the [sample app](https://git.aparoksha.dev/david-swift/term-kit-backend/src/branch/main/Sources/TestApp/TestApp.swift) for more help. diff --git a/Sources/TermKitBackend/TermKitBackend.docc/TermKitBackend.md b/Sources/TermKitBackend/TermKitBackend.docc/TermKitBackend.md index c266577..1c40f58 100644 --- a/Sources/TermKitBackend/TermKitBackend.docc/TermKitBackend.md +++ b/Sources/TermKitBackend/TermKitBackend.docc/TermKitBackend.md @@ -4,5 +4,5 @@ _TermKitBackend_ is a declarative framework allowing the creation of user interf ## Overview -The declarative approach is based on the [Meta package](https://aparokshaui.github.io/meta/) which can be found on [GitHub](https://github.com/AparokshaUI/Meta). +The declarative approach is based on the [Meta package](https://meta.aparoksha.dev/), browse the code [here](https://git.aparoksha.dev/aparoksha/meta). It is powered by [a fork of TermKit for Swift](https://github.com/david-swift/TermKit). diff --git a/Sources/TestApp/TestApp.swift b/Sources/TestApp/TestApp.swift index 4ecb016..49ee64c 100644 --- a/Sources/TestApp/TestApp.swift +++ b/Sources/TestApp/TestApp.swift @@ -13,8 +13,7 @@ struct TestApp: App { @State private var about: Signal = .init() - let id = "io.github.AparokshaUI.TestApp" - var app: TermKitApp! + let app = TermKitApp() var scene: Scene { Window {