Skip to content

Commit 9dc00b0

Browse files
committed
Merge branch 'develop'
2 parents 5d13f3b + 87ea17d commit 9dc00b0

File tree

9 files changed

+63
-23
lines changed

9 files changed

+63
-23
lines changed

AppLogic/Package.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ let package = Package(
1414

1515
// The dependencies.
1616
dependencies: [
17-
.package(url: "[email protected]:55DB091A-8471-447B-8F50-5DFF4C1B14AC/Lighter.git",
18-
branch: "develop"),
19-
.package(url: "[email protected]:55DB091A-8471-447B-8F50-5DFF4C1B14AC/NorthwindSQLite.swift.git",
20-
branch: "develop"),
17+
.package(url: "https://github.com/Lighter-swift/Lighter.git", from: "1.0.4"),
18+
.package(url: "https://github.com/Lighter-swift/NorthwindSQLite.swift.git",
19+
from: "1.0.4"),
2120

2221
.package(url: "https://github.com/Macro-swift/MacroExpress.git",
2322
from: "0.8.8"),

LighterExamples.xcodeproj/project.pbxproj

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
E8224FD628A0073000246A1F /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8224FD428A0073000246A1F /* ContentView.swift */; };
2626
E8224FDA28A0076E00246A1F /* AppDependencies in Frameworks */ = {isa = PBXBuildFile; productRef = E8224FD928A0076E00246A1F /* AppDependencies */; };
2727
E8224FE128A05CB900246A1F /* ProductsList.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8224FE028A05CB900246A1F /* ProductsList.swift */; };
28+
E86B87D728AD4DE400C5B588 /* Lighter in Frameworks */ = {isa = PBXBuildFile; productRef = E86B87D628AD4DE400C5B588 /* Lighter */; };
2829
E87B410D28A3C40500576D8A /* NavView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E87B410C28A3C40500576D8A /* NavView.swift */; };
2930
E87B411228A3C4B900576D8A /* NavVIewProductsList.swift in Sources */ = {isa = PBXBuildFile; fileRef = E87B411128A3C4B900576D8A /* NavVIewProductsList.swift */; };
3031
E87B411428A3C58500576D8A /* MainView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E87B411328A3C58500576D8A /* MainView.swift */; };
@@ -34,8 +35,6 @@
3435
E87B412E28A3DCAD00576D8A /* BodiesApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = E87B412C28A3DCAD00576D8A /* BodiesApp.swift */; };
3536
E87B412F28A3DCAD00576D8A /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E87B412D28A3DCAD00576D8A /* ContentView.swift */; };
3637
E87D45FF28A3C341008E04EA /* NavViewMain.swift in Sources */ = {isa = PBXBuildFile; fileRef = E87D45FE28A3C341008E04EA /* NavViewMain.swift */; };
37-
E8AF70C228A3DD80008444B2 /* Lighter in Frameworks */ = {isa = PBXBuildFile; productRef = E8AF70C128A3DD80008444B2 /* Lighter */; };
38-
E8AF70C828A3DDA7008444B2 /* Lighter in Frameworks */ = {isa = PBXBuildFile; productRef = E8AF70C728A3DDA7008444B2 /* Lighter */; };
3938
/* End PBXBuildFile section */
4039

4140
/* Begin PBXCopyFilesBuildPhase section */
@@ -103,7 +102,6 @@
103102
isa = PBXFrameworksBuildPhase;
104103
buildActionMask = 2147483647;
105104
files = (
106-
E8AF70C228A3DD80008444B2 /* Lighter in Frameworks */,
107105
E8224FBE28A0066800246A1F /* WebDependencies in Frameworks */,
108106
);
109107
runOnlyForDeploymentPostprocessing = 0;
@@ -120,7 +118,7 @@
120118
isa = PBXFrameworksBuildPhase;
121119
buildActionMask = 2147483647;
122120
files = (
123-
E8AF70C828A3DDA7008444B2 /* Lighter in Frameworks */,
121+
E86B87D728AD4DE400C5B588 /* Lighter in Frameworks */,
124122
);
125123
runOnlyForDeploymentPostprocessing = 0;
126124
};
@@ -297,7 +295,6 @@
297295
name = NorthwindWebAPI;
298296
packageProductDependencies = (
299297
E8224FBD28A0066800246A1F /* WebDependencies */,
300-
E8AF70C128A3DD80008444B2 /* Lighter */,
301298
);
302299
productName = NorthwindWebAPI;
303300
productReference = E8224FA328A0063A00246A1F /* NorthwindWebAPI */;
@@ -340,7 +337,7 @@
340337
);
341338
name = Bodies;
342339
packageProductDependencies = (
343-
E8AF70C728A3DDA7008444B2 /* Lighter */,
340+
E86B87D628AD4DE400C5B588 /* Lighter */,
344341
);
345342
productName = Bodies;
346343
productReference = E87B411C28A3DC6500576D8A /* Bodies.app */;
@@ -377,7 +374,7 @@
377374
);
378375
mainGroup = E8224F8228A005CF00246A1F;
379376
packageReferences = (
380-
E8AF70C028A3DD80008444B2 /* XCRemoteSwiftPackageReference "Lighter" */,
377+
E870FE9B28AD4D5700E3FB5A /* XCRemoteSwiftPackageReference "Lighter" */,
381378
);
382379
productRefGroup = E8224F8C28A005CF00246A1F /* Products */;
383380
projectDirPath = "";
@@ -797,6 +794,14 @@
797794
/* End XCConfigurationList section */
798795

799796
/* Begin XCRemoteSwiftPackageReference section */
797+
E870FE9B28AD4D5700E3FB5A /* XCRemoteSwiftPackageReference "Lighter" */ = {
798+
isa = XCRemoteSwiftPackageReference;
799+
repositoryURL = "https://github.com/Lighter-swift/Lighter.git";
800+
requirement = {
801+
kind = upToNextMajorVersion;
802+
minimumVersion = 1.0.4;
803+
};
804+
};
800805
E8AF70C028A3DD80008444B2 /* XCRemoteSwiftPackageReference "Lighter" */ = {
801806
isa = XCRemoteSwiftPackageReference;
802807
repositoryURL = "[email protected]:55DB091A-8471-447B-8F50-5DFF4C1B14AC/Lighter.git";
@@ -824,9 +829,9 @@
824829
isa = XCSwiftPackageProductDependency;
825830
productName = AppDependencies;
826831
};
827-
E8AF70C128A3DD80008444B2 /* Lighter */ = {
832+
E86B87D628AD4DE400C5B588 /* Lighter */ = {
828833
isa = XCSwiftPackageProductDependency;
829-
package = E8AF70C028A3DD80008444B2 /* XCRemoteSwiftPackageReference "Lighter" */;
834+
package = E870FE9B28AD4D5700E3FB5A /* XCRemoteSwiftPackageReference "Lighter" */;
830835
productName = Lighter;
831836
};
832837
E8AF70C328A3DD9C008444B2 /* Enlighter */ = {
@@ -839,11 +844,6 @@
839844
package = E8AF70C028A3DD80008444B2 /* XCRemoteSwiftPackageReference "Lighter" */;
840845
productName = Lighter;
841846
};
842-
E8AF70C728A3DDA7008444B2 /* Lighter */ = {
843-
isa = XCSwiftPackageProductDependency;
844-
package = E8AF70C028A3DD80008444B2 /* XCRemoteSwiftPackageReference "Lighter" */;
845-
productName = Lighter;
846-
};
847847
/* End XCSwiftPackageProductDependency section */
848848
};
849849
rootObject = E8224F8328A005CF00246A1F /* Project object */;

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ var package = Package(
1111
],
1212

1313
dependencies: [
14-
.package(url: "https://github.com/Lighter-swift/Lighter.git", from: "1.0.2"),
14+
.package(url: "https://github.com/Lighter-swift/Lighter.git", from: "1.0.4"),
1515
.package(url: "https://github.com/Lighter-swift/NorthwindSQLite.swift.git",
1616
from: "1.0.4"),
1717

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
Examples for the Lighter SQLite environment, SwiftUI and server side.
77

8-
Note: The examples requires Swift 5.7 / Xcode 14b for proper plugin support.
8+
Note: The examples require Swift 5.7 / Xcode 14b for proper plugin support.
99

1010
When embedding a package using Enlighter (like
1111
[NorthwindSQLite.swift](https://github.com/Lighter-swift/NorthwindSQLite.swift.git)),
@@ -53,6 +53,22 @@ The Swift Northwind API: [Documentation](https://Lighter-swift.github.io/Northwi
5353
This example pulls in a lot of bigger dependencies. A real Lighter project can
5454
actually work w/ no external dependencies at all.
5555

56+
### Screenshots
57+
58+
#### Northwind SwiftUI
59+
60+
<img width="1014" alt="Screenshot 2022-08-16 at 16 41 31" src="https://user-images.githubusercontent.com/7712892/184908144-22cf9a9a-7901-4815-9453-61d8602a093f.png">
61+
62+
#### Northwind Web API
63+
64+
<img width="890" alt="MacroSample-Product-List" src="https://user-images.githubusercontent.com/7712892/184907723-f76691b2-a0bf-4c04-b866-55599603afa4.png">
65+
<img width="890" alt="Macro-Sample-Product-Detail" src="https://user-images.githubusercontent.com/7712892/184907762-cead2c35-1e80-49ce-a5c6-d3522d145411.png">
66+
67+
#### Solar Bodies
68+
69+
<img width="534" alt="Screenshot 2022-08-12 at 16 05 09" src="https://user-images.githubusercontent.com/7712892/184907841-f0aec194-1b60-42c7-a300-561f3349e5ef.png">
70+
71+
5672

5773
### Who
5874

Sources/Bodies/BodiesApp.swift

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,23 @@ struct BodiesApp: App {
77
// "overwrite" can be used during development to get a clean database on
88
// each run.
99
#if DEBUG
10-
let database = try! BodiesDB.bootstrap(overwrite: true)
10+
let database =
11+
try! BodiesDB.bootstrap(into: .cachesDirectory, overwrite: true)
1112
#else
12-
let database = try! BodiesDB.bootstrap()
13+
let database = try! BodiesDB.bootstrap(into: .cachesDirectory)
1314
#endif
15+
16+
init() {
17+
// Check whether a migration is necessary.
18+
let schemaVersion =
19+
try! database.get(pragma: "user_version", as: Int.self)
20+
if schemaVersion != BodiesDB.userVersion {
21+
try! database.fetch("UPDATE") { _, _ in }
22+
23+
print("Dumping cache, the version is outdated.")
24+
_ = try! BodiesDB.bootstrap(overwrite: true)
25+
}
26+
}
1427

1528
var body: some Scene {
1629
WindowGroup {

Sources/Bodies/ContentView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ struct ContentView: View {
8585
}
8686
let result = try JSONDecoder().decode(Result.self, from: data)
8787

88-
// No we need to merge the results we have in the database with the
88+
// Now we need to merge the results we have in the database with the
8989
// once we got from the web.
9090
// We don't actually compare the values, but just overwrite existing
9191
// records if they are still the same.

Sources/Bodies/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ struct ContentView: View {
136136
}
137137
```
138138

139+
### Screenshot
140+
141+
<img width="534" alt="Screenshot 2022-08-12 at 16 05 09" src="https://user-images.githubusercontent.com/7712892/184907841-f0aec194-1b60-42c7-a300-561f3349e5ef.png">
142+
139143

140144
### Who
141145

Sources/NorthwindSwiftUI/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,10 @@ struct ProductPage: View {
146146
}
147147
```
148148

149+
### Screenshot
150+
151+
<img width="1014" alt="Screenshot 2022-08-16 at 16 41 31" src="https://user-images.githubusercontent.com/7712892/184908144-22cf9a9a-7901-4815-9453-61d8602a093f.png">
152+
149153

150154
### Who
151155

Sources/NorthwindWebAPI/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ app // Those hook up the HTML pages/templates.
7373
app.listen(1337) // start server
7474
```
7575

76+
### Screenshots
77+
78+
<img width="890" alt="MacroSample-Product-List" src="https://user-images.githubusercontent.com/7712892/184907723-f76691b2-a0bf-4c04-b866-55599603afa4.png">
79+
<img width="890" alt="Macro-Sample-Product-Detail" src="https://user-images.githubusercontent.com/7712892/184907762-cead2c35-1e80-49ce-a5c6-d3522d145411.png">
7680

7781
### Who
7882

0 commit comments

Comments
 (0)