Skip to content

Commit 3082a71

Browse files
jkmasselkean
authored andcommitted
Refactor Sample App and Logging (#202)
* Refactor sample app to split views * Raise logger messages up to the app level * Address logging suggestions * Address suggestions * Revert port change * fix linter issues * Fix module issue
1 parent d850330 commit 3082a71

20 files changed

+427
-209
lines changed

Package.resolved

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ios/Demo-iOS/Gutenberg.xcodeproj/project.pbxproj

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,41 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 56;
6+
objectVersion = 70;
77
objects = {
88

99
/* Begin PBXBuildFile section */
10-
0C4F59A22BEFF4980028BD96 /* AddSiteView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C4F59A32BEFF4980028BD96 /* AddSiteView.swift */; };
11-
0C4F59A42BEFF4980028BD96 /* AuthenticationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C4F59A52BEFF4980028BD96 /* AuthenticationManager.swift */; };
1210
0C4F59A62BEFF4980028BD96 /* ConfigurationItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C4F59A72BEFF4980028BD96 /* ConfigurationItem.swift */; };
13-
0C4F59A82BEFF4980028BD96 /* ConfigurationStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C4F59A92BEFF4980028BD96 /* ConfigurationStorage.swift */; };
1411
0CE8E78B2C339B0600B9DC67 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0CE8E7842C339B0600B9DC67 /* Assets.xcassets */; };
15-
0CE8E78C2C339B0600B9DC67 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CE8E7852C339B0600B9DC67 /* ContentView.swift */; };
16-
0CE8E78D2C339B0600B9DC67 /* EditorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CE8E7862C339B0600B9DC67 /* EditorView.swift */; };
1712
0CE8E78E2C339B0600B9DC67 /* GutenbergApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CE8E7872C339B0600B9DC67 /* GutenbergApp.swift */; };
1813
0CE8E78F2C339B0600B9DC67 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0CE8E7892C339B0600B9DC67 /* Preview Assets.xcassets */; };
1914
0CF6E04C2BEFF60E00EDEE8A /* GutenbergKit in Frameworks */ = {isa = PBXBuildFile; productRef = 0CF6E04B2BEFF60E00EDEE8A /* GutenbergKit */; };
15+
246852562EAABB7800ED1F09 /* WordPressAPI in Frameworks */ = {isa = PBXBuildFile; productRef = 0C4F59A12BEFF4980028BD96 /* WordPressAPI */; };
16+
2468526B2EAACCA100ED1F09 /* AuthenticationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 246852682EAACCA100ED1F09 /* AuthenticationManager.swift */; };
17+
2468526C2EAACCA100ED1F09 /* ConfigurationStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 246852692EAACCA100ED1F09 /* ConfigurationStorage.swift */; };
2018
/* End PBXBuildFile section */
2119

2220
/* Begin PBXFileReference section */
2321
0C4F598B2BEFF4970028BD96 /* Gutenberg.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Gutenberg.app; sourceTree = BUILT_PRODUCTS_DIR; };
24-
0C4F59A32BEFF4980028BD96 /* AddSiteView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddSiteView.swift; sourceTree = "<group>"; };
25-
0C4F59A52BEFF4980028BD96 /* AuthenticationManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthenticationManager.swift; sourceTree = "<group>"; };
2622
0C4F59A72BEFF4980028BD96 /* ConfigurationItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConfigurationItem.swift; sourceTree = "<group>"; };
27-
0C4F59A92BEFF4980028BD96 /* ConfigurationStorage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConfigurationStorage.swift; sourceTree = "<group>"; };
2823
0CE8E7842C339B0600B9DC67 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
29-
0CE8E7852C339B0600B9DC67 /* ContentView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
30-
0CE8E7862C339B0600B9DC67 /* EditorView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EditorView.swift; sourceTree = "<group>"; };
3124
0CE8E7872C339B0600B9DC67 /* GutenbergApp.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GutenbergApp.swift; sourceTree = "<group>"; };
3225
0CE8E7892C339B0600B9DC67 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
3326
0CE8E7922C339B1B00B9DC67 /* GutenbergKit */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = GutenbergKit; path = ../..; sourceTree = "<group>"; };
27+
246852682EAACCA100ED1F09 /* AuthenticationManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthenticationManager.swift; sourceTree = "<group>"; };
28+
246852692EAACCA100ED1F09 /* ConfigurationStorage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConfigurationStorage.swift; sourceTree = "<group>"; };
3429
/* End PBXFileReference section */
3530

31+
/* Begin PBXFileSystemSynchronizedRootGroup section */
32+
2468525B2EAAC62B00ED1F09 /* Views */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = Views; sourceTree = "<group>"; };
33+
/* End PBXFileSystemSynchronizedRootGroup section */
34+
3635
/* Begin PBXFrameworksBuildPhase section */
3736
0C4F59882BEFF4970028BD96 /* Frameworks */ = {
3837
isa = PBXFrameworksBuildPhase;
3938
buildActionMask = 2147483647;
4039
files = (
40+
246852562EAABB7800ED1F09 /* WordPressAPI in Frameworks */,
4141
0CF6E04C2BEFF60E00EDEE8A /* GutenbergKit in Frameworks */,
4242
);
4343
runOnlyForDeploymentPostprocessing = 0;
@@ -76,12 +76,9 @@
7676
0CE8E7882C339B0600B9DC67 /* Sources */ = {
7777
isa = PBXGroup;
7878
children = (
79-
0C4F59A32BEFF4980028BD96 /* AddSiteView.swift */,
80-
0C4F59A52BEFF4980028BD96 /* AuthenticationManager.swift */,
79+
2468526A2EAACCA100ED1F09 /* Services */,
80+
2468525B2EAAC62B00ED1F09 /* Views */,
8181
0C4F59A72BEFF4980028BD96 /* ConfigurationItem.swift */,
82-
0C4F59A92BEFF4980028BD96 /* ConfigurationStorage.swift */,
83-
0CE8E7852C339B0600B9DC67 /* ContentView.swift */,
84-
0CE8E7862C339B0600B9DC67 /* EditorView.swift */,
8582
0CE8E7872C339B0600B9DC67 /* GutenbergApp.swift */,
8683
);
8784
path = Sources;
@@ -102,6 +99,15 @@
10299
name = Frameworks;
103100
sourceTree = "<group>";
104101
};
102+
2468526A2EAACCA100ED1F09 /* Services */ = {
103+
isa = PBXGroup;
104+
children = (
105+
246852682EAACCA100ED1F09 /* AuthenticationManager.swift */,
106+
246852692EAACCA100ED1F09 /* ConfigurationStorage.swift */,
107+
);
108+
path = Services;
109+
sourceTree = "<group>";
110+
};
105111
/* End PBXGroup section */
106112

107113
/* Begin PBXNativeTarget section */
@@ -117,6 +123,9 @@
117123
);
118124
dependencies = (
119125
);
126+
fileSystemSynchronizedGroups = (
127+
2468525B2EAAC62B00ED1F09 /* Views */,
128+
);
120129
name = Gutenberg;
121130
packageProductDependencies = (
122131
0CF6E04B2BEFF60E00EDEE8A /* GutenbergKit */,
@@ -134,7 +143,7 @@
134143
attributes = {
135144
BuildIndependentTargetsInParallel = 1;
136145
LastSwiftUpdateCheck = 1510;
137-
LastUpgradeCheck = 1510;
146+
LastUpgradeCheck = 2600;
138147
TargetAttributes = {
139148
0C4F598A2BEFF4970028BD96 = {
140149
CreatedOnToolsVersion = 15.1;
@@ -179,13 +188,10 @@
179188
isa = PBXSourcesBuildPhase;
180189
buildActionMask = 2147483647;
181190
files = (
182-
0C4F59A22BEFF4980028BD96 /* AddSiteView.swift in Sources */,
183-
0C4F59A42BEFF4980028BD96 /* AuthenticationManager.swift in Sources */,
184191
0C4F59A62BEFF4980028BD96 /* ConfigurationItem.swift in Sources */,
185-
0C4F59A82BEFF4980028BD96 /* ConfigurationStorage.swift in Sources */,
186192
0CE8E78E2C339B0600B9DC67 /* GutenbergApp.swift in Sources */,
187-
0CE8E78C2C339B0600B9DC67 /* ContentView.swift in Sources */,
188-
0CE8E78D2C339B0600B9DC67 /* EditorView.swift in Sources */,
193+
2468526B2EAACCA100ED1F09 /* AuthenticationManager.swift in Sources */,
194+
2468526C2EAACCA100ED1F09 /* ConfigurationStorage.swift in Sources */,
189195
);
190196
runOnlyForDeploymentPostprocessing = 0;
191197
};
@@ -250,6 +256,7 @@
250256
MTL_FAST_MATH = YES;
251257
ONLY_ACTIVE_ARCH = YES;
252258
SDKROOT = iphoneos;
259+
STRING_CATALOG_GENERATE_SYMBOLS = YES;
253260
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
254261
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
255262
};
@@ -306,6 +313,7 @@
306313
MTL_ENABLE_DEBUG_INFO = NO;
307314
MTL_FAST_MATH = YES;
308315
SDKROOT = iphoneos;
316+
STRING_CATALOG_GENERATE_SYMBOLS = YES;
309317
SWIFT_COMPILATION_MODE = wholemodule;
310318
VALIDATE_PRODUCT = YES;
311319
};
@@ -325,7 +333,6 @@
325333
ENABLE_PREVIEWS = YES;
326334
GENERATE_INFOPLIST_FILE = YES;
327335
INFOPLIST_KEY_CFBundleURLTypes = "$(INFOPLIST_KEY_CFBundleURLTypes)";
328-
"INFOPLIST_KEY_CFBundleURLTypes[0]" = "{ CFBundleURLSchemes = (gutenbergkit); }";
329336
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
330337
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
331338
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
@@ -359,7 +366,6 @@
359366
ENABLE_PREVIEWS = YES;
360367
GENERATE_INFOPLIST_FILE = YES;
361368
INFOPLIST_KEY_CFBundleURLTypes = "$(INFOPLIST_KEY_CFBundleURLTypes)";
362-
"INFOPLIST_KEY_CFBundleURLTypes[0]" = "{ CFBundleURLSchemes = (gutenbergkit); }";
363369
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
364370
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
365371
INFOPLIST_KEY_UILaunchScreen_Generation = YES;

ios/Demo-iOS/Gutenberg.xcodeproj/xcshareddata/xcschemes/Gutenberg.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1540"
3+
LastUpgradeVersion = "2600"
44
version = "1.7">
55
<BuildAction
66
parallelizeBuildables = "YES"

ios/Demo-iOS/Sources/ConfigurationItem.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Foundation
22

33
/// Represents a configuration item for the editor
4-
enum ConfigurationItem: Codable, Identifiable {
4+
enum ConfigurationItem: Codable, Identifiable, Equatable {
55
case bundledEditor
66
case remoteEditor(RemoteEditorConfiguration)
77

@@ -25,7 +25,7 @@ enum ConfigurationItem: Codable, Identifiable {
2525
}
2626

2727
/// Configuration for a remote editor
28-
struct RemoteEditorConfiguration: Codable, Identifiable {
28+
struct RemoteEditorConfiguration: Codable, Identifiable, Equatable {
2929
let id: String
3030
let name: String
3131
let siteUrl: String

ios/Demo-iOS/Sources/ContentView.swift

Lines changed: 0 additions & 171 deletions
This file was deleted.

ios/Demo-iOS/Sources/GutenbergApp.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ struct GutenbergApp: App {
55
var body: some Scene {
66
WindowGroup {
77
NavigationStack {
8-
ContentView()
8+
AppRootView()
99
}
1010
}
11+
.environmentObject(ConfigurationStorage())
12+
.environmentObject(AuthenticationManager())
1113
}
1214
}

0 commit comments

Comments
 (0)