Skip to content

Commit

Permalink
Update to use @Reducer and child store caching (#193)
Browse files Browse the repository at this point in the history
* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* update package.swift

* update swift 5.9.1

* wip

* wip

* wip

* wip

* fixes

* wip

* wip

---------

Co-authored-by: Stephen Celis <[email protected]>
  • Loading branch information
mbrandonw and stephencelis authored Dec 6, 2023
1 parent 0f934ba commit 32f61ae
Show file tree
Hide file tree
Showing 92 changed files with 1,312 additions and 1,355 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ jobs:
run: brew link postgresql@15
- name: Start Postgres
run: brew services start postgresql@15
- name: Select Xcode 14.3
run: sudo xcode-select -s /Applications/Xcode_14.3.app
- name: Select Xcode 15.0.1
run: sudo xcode-select -s /Applications/Xcode_15.0.1.app
- name: Bootstrap
run: make bootstrap
- name: Run tests
Expand All @@ -40,9 +40,6 @@ jobs:
name: Ubuntu
runs-on: ubuntu-20.04
steps:
- uses: swift-actions/setup-swift@v1
with:
swift-version: 5.8
- uses: actions/checkout@v3
- name: Install dependencies
run: 'sudo apt-get --fix-missing update && sudo apt-get install -y wamerican'
Expand Down
3 changes: 1 addition & 2 deletions App/Previews/GameOverPreview/GameOverPreviewApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ extension StoreOf<GameOver> {
} withDependencies: {
$0.apiClient = update(.noop) {
$0.override(
routeCase: (/ServerRoute.Api.Route.games)
.appending(path: /ServerRoute.Api.Route.Games.submit),
routeCase: \.games.submit,
withResponse: { _ in
try await OK(
SubmitGameResponse.solo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/vapor/async-kit.git",
"state" : {
"revision" : "a61da00d404ec91d12766f1b9aac7d90777b484d",
"version" : "1.17.0"
"revision" : "7ece208cd401687641c88367a00e3ea2b04311f1",
"version" : "1.19.0"
}
},
{
Expand Down Expand Up @@ -41,26 +41,35 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/vapor/postgres-nio.git",
"state" : {
"revision" : "5d93f3e05f0493441ad46f6d7a76109ff685329c",
"version" : "1.13.0"
"revision" : "abca6b390235ae337999d367c40cc40c99629385",
"version" : "1.18.1"
}
},
{
"identity" : "sql-kit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/vapor/sql-kit.git",
"state" : {
"revision" : "d547122756534d8224d4599739da0e82e4695623",
"version" : "3.25.0"
"revision" : "b2f128cb62a3abfbb1e3b2893ff3ee69e70f4f0f",
"version" : "3.28.0"
}
},
{
"identity" : "swift-algorithms",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-algorithms.git",
"state" : {
"revision" : "f6919dfc309e7f1b56224378b11e28bab5bccc42",
"version" : "1.2.0"
}
},
{
"identity" : "swift-atomics",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-atomics.git",
"state" : {
"revision" : "6c89474e62719ddcc1e9614989fff2f68208fe10",
"version" : "1.1.0"
"revision" : "cd142fd2f64be2100422d658e7411e39489da985",
"version" : "1.2.0"
}
},
{
Expand All @@ -77,8 +86,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-case-paths",
"state" : {
"revision" : "5da6989aae464f324eef5c5b52bdb7974725ab81",
"version" : "1.0.0"
"revision" : "ed7facdd4a361514b46e3bbc6238cd41c84be4ec",
"version" : "1.1.1"
}
},
{
Expand All @@ -95,26 +104,26 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-collections",
"state" : {
"revision" : "937e904258d22af6e447a0b72c0bc67583ef64a2",
"version" : "1.0.4"
"revision" : "a902f1823a7ff3c9ab2fba0f992396b948eda307",
"version" : "1.0.5"
}
},
{
"identity" : "swift-composable-architecture",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-composable-architecture",
"state" : {
"revision" : "f62ba37cc0c51acb89f6dd1f552f6a1f9c58027c",
"version" : "1.1.0"
"branch" : "main",
"revision" : "af5ae21f65553d5bb39d55d9b4f80182a0c4fcb5"
}
},
{
"identity" : "swift-concurrency-extras",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-concurrency-extras",
"state" : {
"revision" : "ea631ce892687f5432a833312292b80db238186a",
"version" : "1.0.0"
"revision" : "bb5059bde9022d69ac516803f4f227d8ac967f71",
"version" : "1.1.0"
}
},
{
Expand All @@ -131,17 +140,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-custom-dump",
"state" : {
"revision" : "edd66cace818e1b1c6f1b3349bb1d8e00d6f8b01",
"version" : "1.0.0"
"revision" : "65fc9e2b62727cacfab9fc60d580c284a4b9308c",
"version" : "1.1.1"
}
},
{
"identity" : "swift-dependencies",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-dependencies",
"state" : {
"revision" : "4e1eb6e28afe723286d8cc60611237ffbddba7c5",
"version" : "1.0.0"
"revision" : "63301f4a181ed9aefb46dccef2dfb66466798341",
"version" : "1.1.1"
}
},
{
Expand All @@ -162,6 +171,15 @@
"revision" : "14d01d19e43598167a8f8965af478285835ca010"
}
},
{
"identity" : "swift-http-types",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-http-types",
"state" : {
"revision" : "99d066e29effa8845e4761dd3f2f831edfdf8925",
"version" : "1.0.0"
}
},
{
"identity" : "swift-identified-collections",
"kind" : "remoteSourceControl",
Expand All @@ -176,53 +194,71 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-log.git",
"state" : {
"revision" : "32e8d724467f8fe623624570367e3d50c5638e46",
"version" : "1.5.2"
"revision" : "532d8b529501fb73a2455b179e0bbb6d49b652ed",
"version" : "1.5.3"
}
},
{
"identity" : "swift-metrics",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-metrics.git",
"state" : {
"revision" : "e8bced74bc6d747745935e469f45d03f048d6cbd",
"version" : "2.3.4"
"revision" : "971ba26378ab69c43737ee7ba967a896cb74c0d1",
"version" : "2.4.1"
}
},
{
"identity" : "swift-nio",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio.git",
"state" : {
"revision" : "e0cc6dd6ffa8e6a6f565938acd858b24e47902d0",
"version" : "2.50.0"
"revision" : "702cd7c56d5d44eeba73fdf83918339b26dc855c",
"version" : "2.62.0"
}
},
{
"identity" : "swift-nio-extras",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio-extras.git",
"state" : {
"revision" : "0e0d0aab665ff1a0659ce75ac003081f2b1c8997",
"version" : "1.19.0"
"revision" : "798c962495593a23fdea0c0c63fd55571d8dff51",
"version" : "1.20.0"
}
},
{
"identity" : "swift-nio-http2",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio-http2.git",
"state" : {
"revision" : "3bd9004b9d685ed6b629760fc84903e48efec806",
"version" : "1.29.0"
}
},
{
"identity" : "swift-nio-ssl",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio-ssl.git",
"state" : {
"revision" : "9d0d5d8798a576fbf674a823734e65e15ca5f2ec",
"version" : "2.23.1"
"revision" : "320bd978cceb8e88c125dcbb774943a92f6286e9",
"version" : "2.25.0"
}
},
{
"identity" : "swift-nio-transport-services",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio-transport-services.git",
"state" : {
"revision" : "59b966415dd336db6f388bbfe3fb43cfa549b981",
"version" : "1.16.0"
"revision" : "ebf8b9c365a6ce043bf6e6326a04b15589bd285e",
"version" : "1.20.0"
}
},
{
"identity" : "swift-numerics",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-numerics.git",
"state" : {
"revision" : "0a5bc04095a675662cf24757cc0640aa2204253b",
"version" : "1.0.2"
}
},
{
Expand Down Expand Up @@ -257,8 +293,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-snapshot-testing",
"state" : {
"revision" : "cef5b3f6f11781dd4591bdd1dd0a3d22bd609334",
"version" : "1.11.0"
"revision" : "4862d48562483d274a2ac7522d905c9237a31a48",
"version" : "1.15.0"
}
},
{
"identity" : "swift-syntax",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-syntax",
"state" : {
"revision" : "6ad4ea24b01559dde0773e3d091f1b9e36175036",
"version" : "509.0.2"
}
},
{
Expand Down Expand Up @@ -302,8 +347,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swiftui-navigation",
"state" : {
"revision" : "f5bcdac5b6bb3f826916b14705f37a3937c2fd34",
"version" : "1.0.0"
"revision" : "78f9d72cf667adb47e2040aa373185c88c63f0dc",
"version" : "1.2.0"
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions Bootstrap/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM swift:5.8 as build
FROM swift:5.9.1 as build

RUN apt-get --fix-missing update
RUN apt-get install -y cmake libpq-dev libssl-dev libz-dev openssl python
Expand Down Expand Up @@ -26,7 +26,7 @@ RUN swift build \
--product server \
-Xswiftc -g

FROM swift:5.8-slim
FROM swift:5.9.1-slim

RUN apt-get --fix-missing update
RUN apt-get install -y libpq-dev libsqlite3-dev libssl-dev libz-dev openssl python
Expand Down
43 changes: 29 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,49 +26,59 @@ else
@git lfs pull
endif

PLATFORM_IOS = iOS Simulator,name=iPhone 14 Pro,OS=16.4
PLATFORM_IOS = iOS Simulator,id=$(call udid_for,iOS 17,iPhone \d\+ Pro [^M])
test-client:
@xcodebuild test \
-project App/isowords.xcodeproj \
-scheme isowords \
-destination platform="$(PLATFORM_IOS)"
-destination platform="$(PLATFORM_IOS)" \
-skipMacroValidation

build-client-preview-apps:
@xcodebuild \
-project App/isowords.xcodeproj \
-list
-list \
-skipMacroValidation
@xcodebuild \
-project App/isowords.xcodeproj \
-scheme CubeCorePreview \
-destination platform="$(PLATFORM_IOS)"
-destination platform="$(PLATFORM_IOS)" \
-skipMacroValidation
@xcodebuild \
-project App/isowords.xcodeproj \
-scheme CubePreviewPreview \
-destination platform="$(PLATFORM_IOS)"
-destination platform="$(PLATFORM_IOS)" \
-skipMacroValidation
@xcodebuild \
-project App/isowords.xcodeproj \
-scheme GameOverPreview \
-destination platform="$(PLATFORM_IOS)"
-destination platform="$(PLATFORM_IOS)" \
-skipMacroValidation
@xcodebuild \
-project App/isowords.xcodeproj \
-scheme HomeFeaturePreview \
-destination platform="$(PLATFORM_IOS)"
-destination platform="$(PLATFORM_IOS)" \
-skipMacroValidation
@xcodebuild \
-project App/isowords.xcodeproj \
-scheme LeaderboardsPreview \
-destination platform="$(PLATFORM_IOS)"
-destination platform="$(PLATFORM_IOS)" \
-skipMacroValidation
@xcodebuild \
-project App/isowords.xcodeproj \
-scheme OnboardingPreview \
-destination platform="$(PLATFORM_IOS)"
-destination platform="$(PLATFORM_IOS)" \
-skipMacroValidation
@xcodebuild \
-project App/isowords.xcodeproj \
-scheme SettingsPreview \
-destination platform="$(PLATFORM_IOS)"
-destination platform="$(PLATFORM_IOS)" \
-skipMacroValidation
@xcodebuild \
-project App/isowords.xcodeproj \
-scheme UpgradeInterstitialPreview \
-destination platform="$(PLATFORM_IOS)"
-destination platform="$(PLATFORM_IOS)" \
-skipMacroValidation

clean-client: clean-audio

Expand Down Expand Up @@ -203,7 +213,7 @@ run-server-linux:
--build

test-server-linux:
docker run --rm -v "$(PWD):$(PWD)" -w "$(PWD)" swift:5.8-focal bash Bootstrap/test.sh
docker run --rm -v "$(PWD):$(PWD)" -w "$(PWD)" swift:5.9.1-focal bash Bootstrap/test.sh

clean-server: clean-db

Expand Down Expand Up @@ -260,8 +270,9 @@ archive-marketing: check-porcelain set-marketing-version archive

archive: bootstrap-client
@$(MAKE) bump-build
@cd App && xcodebuild -project isowords.xcodeproj -scheme "isowords" archive \
|| (git checkout . && echo " 🛑 Failed to build archive" && exit 1)
@cd App \
&& xcodebuild -project isowords.xcodeproj -scheme "isowords" -skipMacroValidation archive \
|| (git checkout . && echo " 🛑 Failed to build archive" && exit 1)
@git add . && git commit -m "Bumped version to $$(cd App && agvtool what-version -terse)"
@git tag -a "archive-$$(cd App && agvtool what-version -terse)" -m "Archive"
@git tag -a "$$(cd App && agvtool what-marketing-version -terse1)" -f -m "Marketing Version"
Expand Down Expand Up @@ -361,3 +372,7 @@ define POSTGRES_WARNING

endef
export POSTGRES_WARNING

define udid_for
$(shell xcrun simctl list devices available '$(1)' | grep '$(2)' | sort -r | head -1 | awk -F '[()]' '{ print $$(NF-3) }')
endef
Loading

0 comments on commit 32f61ae

Please sign in to comment.