Skip to content

Commit

Permalink
Update scripts and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsaidi committed Oct 4, 2024
1 parent 92ac8bf commit c4ccd3c
Show file tree
Hide file tree
Showing 20 changed files with 198 additions and 166 deletions.
12 changes: 0 additions & 12 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1 @@
# These are supported funding model platforms

github: [danielsaidi]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
11 changes: 4 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,9 @@ name: Build Runner

on:
push:
branches: ["master"]
branches: ["main"]
pull_request:
branches: ["master"]

env:
SCHEME: DeckKit
branches: ["main"]

jobs:
build:
Expand All @@ -21,6 +18,6 @@ jobs:
with:
xcode-version: '16.0'
- name: Build all platforms
run: bash scripts/build.sh $SCHEME
run: bash scripts/build.sh ${{ github.event.repository.name }}
- name: Test iOS
run: bash scripts/test.sh $SCHEME
run: bash scripts/test.sh ${{ github.event.repository.name }}
16 changes: 1 addition & 15 deletions .github/workflows/docc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ on:
push:
branches: ["master"]

env:
SCHEME: DeckKit

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
Expand Down Expand Up @@ -39,18 +36,7 @@ jobs:
with:
xcode-version: '16.0'
- name: Build DocC
run: |
swift package resolve;
xcodebuild docbuild -scheme DeckKit -derivedDataPath /tmp/docbuild -destination 'generic/platform=iOS';
$(xcrun --find docc) process-archive \
transform-for-static-hosting /tmp/docbuild/Build/Products/Debug-iphoneos/DeckKit.doccarchive \
--output-path .build/docs \
--hosting-base-path 'DeckKit';
echo "<script>window.location.href += \"/documentation/deckkit\"</script>" > .build/docs/index.html;
run: bash scripts/docc.sh ${{ github.event.repository.name }}
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
Expand Down
9 changes: 1 addition & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,4 @@
Docs
documentation
downloads
videos

# Fastlane
Fastlane/report.xml
Fastlane/Preview.html
Fastlane/screenshots
Fastlane/test_output
Fastlane/README.md
videos
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,25 @@

<p align="center">
<img src="https://img.shields.io/github/v/release/danielsaidi/DeckKit?color=%2300550&sort=semver" alt="Version" />
<img src="https://img.shields.io/badge/Swift-5.9-orange.svg" alt="Swift 5.9" />
<img src="https://img.shields.io/badge/Swift-6.0-orange.svg" alt="Swift 6.0" />
<img src="https://img.shields.io/badge/platform-SwiftUI-blue.svg" alt="Swift UI" title="Swift UI" />
<img src="https://img.shields.io/github/license/danielsaidi/DeckKit" alt="MIT License" />
<a href="https://twitter.com/danielsaidi"><img src="https://img.shields.io/twitter/url?label=Twitter&style=social&url=https%3A%2F%2Ftwitter.com%2Fdanielsaidi" alt="Twitter: @danielsaidi" title="Twitter: @danielsaidi" /></a>
<a href="https://mastodon.social/@danielsaidi"><img src="https://img.shields.io/mastodon/follow/000253346?label=mastodon&style=social" alt="Mastodon: @danielsaidi@mastodon.social" title="Mastodon: @danielsaidi@mastodon.social" /></a>
</p>



## About DeckKit

DeckKit is a Swift SDK that helps you build deck-based apps in SwiftUI.
DeckKit is a SwiftUI SDK that helps you build deck-based apps.

DeckKit has a `DeckView` that can render any item collection, with support for swipe gestures, edge swipe detection, shuffling, etc. The result can look like this or completely different:
DeckKit has a `DeckView` component that can render any ``DeckItem`` collection, with support for swipe gestures, edge swipes, shuffling, etc. The result can look like this, or completely different:

<p align="center" style="border-radius: 10px">
<img src="Resources/Demo.gif" width=300 alt="Demo video" />
</p>

DeckKit has other views as well, and can be customized to great extent. You can change colors, fonts, etc. and use completely custom views. It also has tools to manage favorite items.
DeckKit can be customized to great extent. You can change colors, fonts, etc. and use completely custom views. It also has tools to manage favorites.



Expand All @@ -39,7 +38,7 @@ https://github.com/danielsaidi/DeckKit.git

## Getting started

With DeckKit, you can create a `Deck` of any model that implement the `DeckItem` protocol:
With DeckKit, you can create a `Deck` of any model that conform to `DeckItem`:

```swift
struct Hobby: DeckItem {
Expand Down Expand Up @@ -70,19 +69,19 @@ struct MyView: View {
}
```

For more information, see the [getting started guide][Getting-Started].
See the online [getting started guide][Getting-Started] for more information.



## Documentation

The [online documentation][Documentation] has more information, articles, code examples, etc.
The online [documentation][Documentation] has more information, articles, code examples, etc.



## Demo Application

The demo app lets you explore the library with iOS, macOS, and visionOS. To try it out, just open and run the `Demo` project.
The `Demo` folder has an app that lets you test the library on iOS, macOS, and visionOS.



Expand Down
7 changes: 7 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ DeckKit tries to honor semantic versioning:
These release notes only cover the current major version.



## 1.4

This version makes the SDK use Swift 6.



## 1.3

This version has breaking changes for the favorite context/service setup, to make favorites easier to use.
Expand Down
6 changes: 3 additions & 3 deletions Sources/DeckKit/DeckKit.docc/DeckKit.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ DeckKit is a SwiftUI SDK that helps you build deck-based apps.

![DeckKit logo](Logo.png)

DeckKit is a Swift SDK that helps you build deck-based apps in SwiftUI.
DeckKit is a SwiftUI SDK that helps you build deck-based apps.

DeckKit has a ``DeckItem`` protocol that is automatically implemented by any type that implements `Identifiable` and `Equatable`, and extends any such ``Swift/Array`` with more functionality.
DeckKit has a ``DeckView`` component that can render any ``DeckItem`` collection, with support for swipe gestures, edge swipes, shuffling, etc.

DeckKit has a ``DeckView`` that can render an item collection as a physical deck of cards, as well as a ``DeckPageView`` that renders an item collection as a horizontally scrolling page view.
The ``DeckItem`` type is a typealias that is automatically implemented by any type that implements `Identifiable` and `Equatable`, and extends any such ``Swift/Array`` with more functionality.

DeckKit can be customized to great extent. You can change colors, fonts, corner radius etc., and use completely custom views. You can also use a ``FavoriteContext`` to manage the favorite state of any `Identifiable` type.

Expand Down
18 changes: 9 additions & 9 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
#!/bin/bash

# Build a <TARGET> for all supported platforms.

# USAGE: bash scripts/build.sh <TARGET>
# Documentation:
# This script builds a <TARGET> for all supported platforms.

# Exit immediately if a command exits with a non-zero status
set -e

# Create local argument variables.
TARGET=$1

# Check if target is provided
# Verify that all required arguments are provided
if [ $# -eq 0 ]; then
echo "Error: No target specified"
echo "Error: This script requires exactly one argument"
echo "Usage: $0 <TARGET>"
exit 1
fi

# Use the script folder to refer to the platform script.
# Create local argument variables.
TARGET=$1

# Use the script folder to refer to other scripts.
FOLDER="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
SCRIPT="$FOLDER/build_platform.sh"

Expand Down
10 changes: 8 additions & 2 deletions scripts/build_platform.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
#!/bin/bash

# Build a <TARGET> for a specific platform.
# Documentation:
# This script builds a <TARGET> for a specific <PLATFORM>.

# USAGE: bash scripts/build_platform.sh <TARGET> <PLATFORM>
# Verify that all required arguments are provided
if [ $# -ne 2 ]; then
echo "Error: This script requires exactly two arguments"
echo "Usage: $0 <TARGET> <PLATFORM>"
exit 1
fi

TARGET=$1
PLATFORM=$2
Expand Down
13 changes: 10 additions & 3 deletions scripts/docc.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
#!/bin/bash

# Build DocC documentation for a <TARGET> to .build/docs.
# Documentation:
# This script build DocC for a <TARGET>.
# The documentation ends up in to .build/docs.

# USAGE: bash scripts/docc.sh <TARGET>
# Verify that all required arguments are provided
if [ $# -eq 0 ]; then
echo "Error: This script requires exactly one argument"
echo "Usage: $0 <TARGET>"
exit 1
fi

TARGET=$1
TARGET_LOWERCASED=$(echo "$1" | tr '[:upper:]' '[:lower:]')
Expand All @@ -14,6 +21,6 @@ xcodebuild docbuild -scheme $1 -derivedDataPath /tmp/docbuild -destination 'gene
$(xcrun --find docc) process-archive \
transform-for-static-hosting /tmp/docbuild/Build/Products/Debug-iphoneos/$1.doccarchive \
--output-path .build/docs \
--hosting-base-path '$1';
--hosting-base-path "$TARGET";

echo "<script>window.location.href += \"/documentation/$TARGET_LOWERCASED\"</script>" > .build/docs/index.html;
28 changes: 14 additions & 14 deletions scripts/test.sh
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
#!/bin/bash

# Test a <TARGET> for all supported platforms.

# USAGE: bash scripts/test.sh <TARGET>
# Documentation:
# This script tests a <TARGET> for all supported platforms.

# Exit immediately if a command exits with a non-zero status
set -e

# Create local argument variables.
TARGET=$1

# Check if target is provided
# Verify that all required arguments are provided
if [ $# -eq 0 ]; then
echo "Error: No target specified"
echo "Error: This script requires exactly one argument"
echo "Usage: $0 <TARGET>"
exit 1
fi

# Use the script folder to refer to the platform script.
# Create local argument variables.
TARGET=$1

# Use the script folder to refer to other scripts.
FOLDER="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
SCRIPT="$FOLDER/test_platform.sh"

# Make the script executable
chmod +x $SCRIPT

# A function that builds a specific platform
# A function that tests a specific platform
test_platform() {
local platform=$1
echo "Building for $platform..."
echo "Testing for $platform..."
if ! bash $SCRIPT $TARGET $platform; then
echo "Failed to build $platform"
echo "Failed to test $platform"
return 1
fi
echo "Successfully built $platform"
echo "Successfully tested $platform"
}

# Array of platforms to build
# Array of platforms to test
platforms=("platform=iOS_Simulator,name=iPhone_16")

# Loop through platforms and build
Expand Down
11 changes: 8 additions & 3 deletions scripts/test_platform.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
#!/bin/bash

# Test the SDK for a specific platform.

# Documentation:
# This script tests a <TARGET> for a specific platform.
# Use _ instead of spaces when passing in the <PLATFORM>.

# USAGE: bash scripts/build_platform.sh <TARGET> <PLATFORM>
# Verify that all required arguments are provided
if [ $# -ne 2 ]; then
echo "Error: This script requires exactly two arguments"
echo "Usage: $0 <TARGET> <PLATFORM>"
exit 1
fi

TARGET=$1
PLATFORM="${2//_/ }"
Expand Down
42 changes: 0 additions & 42 deletions scripts/validate_git.sh

This file was deleted.

7 changes: 0 additions & 7 deletions scripts/validate_project.sh

This file was deleted.

Loading

0 comments on commit c4ccd3c

Please sign in to comment.