Skip to content

Commit c4ccd3c

Browse files
committed
Update scripts and readme
1 parent 92ac8bf commit c4ccd3c

20 files changed

+198
-166
lines changed

.github/FUNDING.yml

-12
Original file line numberDiff line numberDiff line change
@@ -1,13 +1 @@
1-
# These are supported funding model platforms
2-
31
github: [danielsaidi]
4-
patreon: # Replace with a single Patreon username
5-
open_collective: # Replace with a single Open Collective username
6-
ko_fi: # Replace with a single Ko-fi username
7-
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8-
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9-
liberapay: # Replace with a single Liberapay username
10-
issuehunt: # Replace with a single IssueHunt username
11-
otechie: # Replace with a single Otechie username
12-
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
13-
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

.github/workflows/build.yml

+4-7
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,9 @@ name: Build Runner
55

66
on:
77
push:
8-
branches: ["master"]
8+
branches: ["main"]
99
pull_request:
10-
branches: ["master"]
11-
12-
env:
13-
SCHEME: DeckKit
10+
branches: ["main"]
1411

1512
jobs:
1613
build:
@@ -21,6 +18,6 @@ jobs:
2118
with:
2219
xcode-version: '16.0'
2320
- name: Build all platforms
24-
run: bash scripts/build.sh $SCHEME
21+
run: bash scripts/build.sh ${{ github.event.repository.name }}
2522
- name: Test iOS
26-
run: bash scripts/test.sh $SCHEME
23+
run: bash scripts/test.sh ${{ github.event.repository.name }}

.github/workflows/docc.yml

+1-15
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ on:
88
push:
99
branches: ["master"]
1010

11-
env:
12-
SCHEME: DeckKit
13-
1411
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
1512
permissions:
1613
contents: read
@@ -39,18 +36,7 @@ jobs:
3936
with:
4037
xcode-version: '16.0'
4138
- name: Build DocC
42-
run: |
43-
swift package resolve;
44-
45-
xcodebuild docbuild -scheme DeckKit -derivedDataPath /tmp/docbuild -destination 'generic/platform=iOS';
46-
47-
$(xcrun --find docc) process-archive \
48-
transform-for-static-hosting /tmp/docbuild/Build/Products/Debug-iphoneos/DeckKit.doccarchive \
49-
--output-path .build/docs \
50-
--hosting-base-path 'DeckKit';
51-
52-
echo "<script>window.location.href += \"/documentation/deckkit\"</script>" > .build/docs/index.html;
53-
39+
run: bash scripts/docc.sh ${{ github.event.repository.name }}
5440
- name: Upload artifact
5541
uses: actions/upload-pages-artifact@v3
5642
with:

.gitignore

+1-8
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,4 @@
99
Docs
1010
documentation
1111
downloads
12-
videos
13-
14-
# Fastlane
15-
Fastlane/report.xml
16-
Fastlane/Preview.html
17-
Fastlane/screenshots
18-
Fastlane/test_output
19-
Fastlane/README.md
12+
videos

README.md

+8-9
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,25 @@
44

55
<p align="center">
66
<img src="https://img.shields.io/github/v/release/danielsaidi/DeckKit?color=%2300550&sort=semver" alt="Version" />
7-
<img src="https://img.shields.io/badge/Swift-5.9-orange.svg" alt="Swift 5.9" />
7+
<img src="https://img.shields.io/badge/Swift-6.0-orange.svg" alt="Swift 6.0" />
88
<img src="https://img.shields.io/badge/platform-SwiftUI-blue.svg" alt="Swift UI" title="Swift UI" />
99
<img src="https://img.shields.io/github/license/danielsaidi/DeckKit" alt="MIT License" />
1010
<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>
1111
<a href="https://mastodon.social/@danielsaidi"><img src="https://img.shields.io/mastodon/follow/000253346?label=mastodon&style=social" alt="Mastodon: @[email protected]" title="Mastodon: @[email protected]" /></a>
1212
</p>
1313

1414

15-
1615
## About DeckKit
1716

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

20-
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:
19+
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:
2120

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

26-
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.
25+
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.
2726

2827

2928

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

4039
## Getting started
4140

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

4443
```swift
4544
struct Hobby: DeckItem {
@@ -70,19 +69,19 @@ struct MyView: View {
7069
}
7170
```
7271

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

7574

7675

7776
## Documentation
7877

79-
The [online documentation][Documentation] has more information, articles, code examples, etc.
78+
The online [documentation][Documentation] has more information, articles, code examples, etc.
8079

8180

8281

8382
## Demo Application
8483

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

8786

8887

RELEASE_NOTES.md

+7
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ DeckKit tries to honor semantic versioning:
1010
These release notes only cover the current major version.
1111

1212

13+
14+
## 1.4
15+
16+
This version makes the SDK use Swift 6.
17+
18+
19+
1320
## 1.3
1421

1522
This version has breaking changes for the favorite context/service setup, to make favorites easier to use.

Sources/DeckKit/DeckKit.docc/DeckKit.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ DeckKit is a SwiftUI SDK that helps you build deck-based apps.
88

99
![DeckKit logo](Logo.png)
1010

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

13-
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.
13+
DeckKit has a ``DeckView`` component that can render any ``DeckItem`` collection, with support for swipe gestures, edge swipes, shuffling, etc.
1414

15-
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.
15+
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.
1616

1717
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.
1818

scripts/build.sh

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
#!/bin/bash
22

3-
# Build a <TARGET> for all supported platforms.
4-
5-
# USAGE: bash scripts/build.sh <TARGET>
3+
# Documentation:
4+
# This script builds a <TARGET> for all supported platforms.
65

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

10-
# Create local argument variables.
11-
TARGET=$1
12-
13-
# Check if target is provided
9+
# Verify that all required arguments are provided
1410
if [ $# -eq 0 ]; then
15-
echo "Error: No target specified"
11+
echo "Error: This script requires exactly one argument"
12+
echo "Usage: $0 <TARGET>"
1613
exit 1
1714
fi
1815

19-
# Use the script folder to refer to the platform script.
16+
# Create local argument variables.
17+
TARGET=$1
18+
19+
# Use the script folder to refer to other scripts.
2020
FOLDER="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
2121
SCRIPT="$FOLDER/build_platform.sh"
2222

scripts/build_platform.sh

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
#!/bin/bash
22

3-
# Build a <TARGET> for a specific platform.
3+
# Documentation:
4+
# This script builds a <TARGET> for a specific <PLATFORM>.
45

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

713
TARGET=$1
814
PLATFORM=$2

scripts/docc.sh

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
#!/bin/bash
22

3-
# Build DocC documentation for a <TARGET> to .build/docs.
3+
# Documentation:
4+
# This script build DocC for a <TARGET>.
5+
# The documentation ends up in to .build/docs.
46

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

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

1926
echo "<script>window.location.href += \"/documentation/$TARGET_LOWERCASED\"</script>" > .build/docs/index.html;

scripts/test.sh

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
11
#!/bin/bash
22

3-
# Test a <TARGET> for all supported platforms.
4-
5-
# USAGE: bash scripts/test.sh <TARGET>
3+
# Documentation:
4+
# This script tests a <TARGET> for all supported platforms.
65

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

10-
# Create local argument variables.
11-
TARGET=$1
12-
13-
# Check if target is provided
9+
# Verify that all required arguments are provided
1410
if [ $# -eq 0 ]; then
15-
echo "Error: No target specified"
11+
echo "Error: This script requires exactly one argument"
12+
echo "Usage: $0 <TARGET>"
1613
exit 1
1714
fi
1815

19-
# Use the script folder to refer to the platform script.
16+
# Create local argument variables.
17+
TARGET=$1
18+
19+
# Use the script folder to refer to other scripts.
2020
FOLDER="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
2121
SCRIPT="$FOLDER/test_platform.sh"
2222

2323
# Make the script executable
2424
chmod +x $SCRIPT
2525

26-
# A function that builds a specific platform
26+
# A function that tests a specific platform
2727
test_platform() {
2828
local platform=$1
29-
echo "Building for $platform..."
29+
echo "Testing for $platform..."
3030
if ! bash $SCRIPT $TARGET $platform; then
31-
echo "Failed to build $platform"
31+
echo "Failed to test $platform"
3232
return 1
3333
fi
34-
echo "Successfully built $platform"
34+
echo "Successfully tested $platform"
3535
}
3636

37-
# Array of platforms to build
37+
# Array of platforms to test
3838
platforms=("platform=iOS_Simulator,name=iPhone_16")
3939

4040
# Loop through platforms and build

scripts/test_platform.sh

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
#!/bin/bash
22

3-
# Test the SDK for a specific platform.
4-
3+
# Documentation:
4+
# This script tests a <TARGET> for a specific platform.
55
# Use _ instead of spaces when passing in the <PLATFORM>.
66

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

914
TARGET=$1
1015
PLATFORM="${2//_/ }"

scripts/validate_git.sh

-42
This file was deleted.

scripts/validate_project.sh

-7
This file was deleted.

0 commit comments

Comments
 (0)