expo-dev-launcher 0.7.0 → 0.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/README.md +1 -1
  3. package/android/build.gradle +2 -1
  4. package/android/src/debug/assets/expo_dev_launcher_android.bundle +396 -403
  5. package/android/src/debug/java/expo/modules/devlauncher/DevLauncherController.kt +10 -6
  6. package/android/src/debug/java/expo/modules/devlauncher/launcher/loaders/DevLauncherAppLoaderFactory.kt +5 -5
  7. package/android/src/debug/java/expo/modules/devlauncher/launcher/loaders/DevLauncherExpoAppLoader.kt +5 -5
  8. package/android/src/debug/java/expo/modules/devlauncher/launcher/loaders/DevLauncherLocalAppLoader.kt +3 -3
  9. package/android/src/debug/java/expo/modules/devlauncher/launcher/loaders/DevLauncherPublishedAppLoader.kt +2 -6
  10. package/android/src/debug/java/expo/modules/devlauncher/modules/DevLauncherInternalModule.kt +6 -1
  11. package/android/src/debug/java/expo/modules/devlauncher/modules/DevLauncherModule.kt +1 -1
  12. package/android/src/main/java/expo/modules/devlauncher/launcher/DevLauncherControllerInterface.kt +2 -2
  13. package/android/src/main/java/expo/modules/devlauncher/launcher/configurators/DevLauncherExpoActivityConfigurator.kt +12 -11
  14. package/android/src/main/java/expo/modules/devlauncher/launcher/manifest/DevLauncherManifestParser.kt +4 -2
  15. package/android/src/main/java/expo/modules/devlauncher/launcher/manifest/DevLauncherManifestTypes.kt +11 -26
  16. package/android/src/main/java/expo/modules/devlauncher/launcher/menu/DevLauncherMenuDelegate.kt +3 -3
  17. package/android/src/release/java/expo/modules/devlauncher/DevLauncherController.kt +2 -2
  18. package/android/src/testDebug/java/expo/modules/devlauncher/DevLauncherControllerTest.kt +50 -0
  19. package/android/src/testDebug/java/expo/modules/devlauncher/launcher/DevLauncherRecentlyOpenedAppsRegistryTest.kt +43 -0
  20. package/android/src/testDebug/java/expo/modules/devlauncher/launcher/loaders/DevLauncherAppLoaderFactoryTest.kt +3 -3
  21. package/android/src/testDebug/java/expo/modules/devlauncher/modules/DevLauncherModuleTest.kt +38 -0
  22. package/build/DevLauncherErrorManager.js +7 -0
  23. package/build/DevLauncherErrorManager.js.map +1 -1
  24. package/expo-dev-launcher.podspec +2 -0
  25. package/ios/EXDevLauncher.m +8 -2
  26. package/ios/EXDevLauncher.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  27. package/ios/EXDevLauncher.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  28. package/ios/EXDevLauncher.xcodeproj/xcuserdata/brentvatne.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
  29. package/ios/EXDevLauncher.xcworkspace/xcuserdata/brentvatne.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  30. package/ios/EXDevLauncherController.h +2 -2
  31. package/ios/EXDevLauncherController.m +22 -11
  32. package/ios/EXDevLauncherInternal.m +5 -0
  33. package/ios/EXDevLauncherMenuDelegate.swift +3 -3
  34. package/ios/Errors/EXDevLauncherRedBox.m +5 -0
  35. package/ios/Manifest/EXDevLauncherManifestHelper.swift +15 -12
  36. package/ios/Manifest/EXDevLauncherManifestParser.h +3 -3
  37. package/ios/Manifest/EXDevLauncherManifestParser.m +17 -5
  38. package/ios/Tests/EXDevLauncherManifestHelperTests.swift +28 -0
  39. package/ios/Tests/EXDevLauncherManifestParserTests.m +113 -0
  40. package/ios/Tests/EXDevLauncherModuleTests.m +39 -0
  41. package/ios/devvyc 2021-05-14 18-19-10/devvyc.ipa +0 -0
  42. package/ios/main.jsbundle +414 -420
  43. package/package.json +6 -6
  44. package/plugin/build/constants.d.ts +1 -0
  45. package/plugin/build/constants.js +4 -0
  46. package/plugin/build/utils.d.ts +2 -0
  47. package/plugin/build/utils.js +24 -0
  48. package/plugin/build/withDevLauncher.js +27 -39
  49. package/plugin/build/withDevLauncherAppDelegate.d.ts +1 -0
  50. package/plugin/build/withDevLauncherAppDelegate.js +161 -16
  51. package/plugin/src/constants.ts +1 -0
  52. package/plugin/src/utils.ts +25 -0
  53. package/plugin/src/withDevLauncher.ts +32 -45
  54. package/plugin/src/withDevLauncherAppDelegate.ts +211 -23
  55. package/src/DevLauncherErrorManager.ts +7 -0
  56. package/android/src/main/java/expo/modules/devlauncher/launcher/manifest/DevLauncherManifest.kt +0 -111
  57. package/ios/Manifest/EXDevLauncherManifest.swift +0 -158
@@ -1,158 +0,0 @@
1
- // Copyright 2015-present 650 Industries. All rights reserved.
2
-
3
- import Foundation
4
-
5
- enum EXDevLauncherOrientation: String, Decodable {
6
- case defaulted = "default" // "default" cannot be used as an identifiere
7
- case portrait = "portrait"
8
- case landscape = "landscape"
9
- }
10
-
11
- enum EXDevLauncherUserInterfaceStyle: String, Decodable {
12
- case automatic = "automatic"
13
- case light = "light"
14
- case dark = "dark"
15
- }
16
-
17
- @propertyWrapper
18
- public class CanHavePlatformSpecificValue<T> : Decodable where T : Decodable {
19
- public var wrappedValue: T
20
-
21
- /**
22
- This constructor shouldn't be called. However, we need that to implement the `Decodable` protocol.
23
- */
24
- required public init(from decoder: Decoder) throws {
25
- throw NSError()
26
- }
27
-
28
- public init(_ value: T) {
29
- wrappedValue = value
30
- }
31
- }
32
-
33
- @objc
34
- public class iOSSection: NSObject, Decodable {}
35
-
36
- @objc
37
- public class DeveloperSection: NSObject, Decodable {
38
- @objc
39
- public var tool: String?
40
-
41
- public enum CodingKeys: String, CodingKey {
42
- case tool
43
- }
44
- }
45
-
46
- @objc
47
- public class EXDevLauncherManifest: NSObject, Decodable {
48
- @objc
49
- var _rawData: String? = nil
50
-
51
- @objc
52
- public var rawData: String? {
53
- return _rawData
54
- }
55
-
56
- @objc
57
- public var name: String
58
-
59
- @objc
60
- public var slug: String
61
-
62
- @objc
63
- public var version: String
64
-
65
- @objc
66
- public var bundleUrl: String
67
-
68
- @CanHavePlatformSpecificValue
69
- var _userInterfaceStyle: EXDevLauncherUserInterfaceStyle?
70
-
71
- @objc
72
- @available(iOS 12.0, *)
73
- public var userInterfaceStyle: UIUserInterfaceStyle {
74
- return EXDevLauncherManifestHelper.exportManifestUserInterfaceStyle(_userInterfaceStyle);
75
- }
76
-
77
- @CanHavePlatformSpecificValue
78
- var _backgroundColor: String?
79
-
80
- @objc
81
- public var backgroundColor: UIColor? {
82
- return EXDevLauncherManifestHelper.hexStringToColor(_backgroundColor)
83
- }
84
-
85
- @CanHavePlatformSpecificValue
86
- var _orientation: EXDevLauncherOrientation?
87
-
88
- @objc
89
- public var orientation: UIInterfaceOrientation {
90
- return EXDevLauncherManifestHelper.exportManifestOrientation(_orientation)
91
- }
92
-
93
- @objc
94
- public var developer: DeveloperSection?
95
-
96
- var ios: iOSSection?
97
-
98
- public enum CodingKeys: String, CodingKey {
99
- case name, slug, version, ios, bundleUrl, developer
100
- case _backgroundColor = "backgroundColor"
101
- case _orientation = "orientation"
102
- case _userInterfaceStyle = "userInterfaceStyle"
103
- }
104
-
105
- @objc
106
- public static func fromJsonObject(_ jsonObject: NSDictionary) -> EXDevLauncherManifest? {
107
- do {
108
- let data = try JSONSerialization.data(withJSONObject: jsonObject, options: [])
109
- return fromJsonData(data)
110
- } catch {
111
- return nil
112
- }
113
- }
114
-
115
- @objc
116
- public static func fromJsonData(_ jsonData: Data) -> EXDevLauncherManifest? {
117
- let decoder = JSONDecoder()
118
- do {
119
- let rawManifest = String(decoding: jsonData, as: UTF8.self)
120
- let decodedManifest = try decoder.decode(EXDevLauncherManifest.self, from: jsonData)
121
- decodedManifest._rawData = rawManifest
122
- return decodedManifest
123
- } catch {
124
- return nil
125
- }
126
- }
127
-
128
- @objc
129
- public func isUsingDeveloperTool() -> Bool {
130
- return self.developer?.tool != nil;
131
- }
132
- }
133
-
134
- public extension KeyedDecodingContainer where Key == EXDevLauncherManifest.CodingKeys {
135
- func decode<T : Decodable>(_ type: CanHavePlatformSpecificValue<T>.Type, forKey key: Key) throws -> CanHavePlatformSpecificValue<T> {
136
- let scopedValue = decodedFromIOSSection(T.self, forKey: key)
137
- if scopedValue != nil {
138
- return CanHavePlatformSpecificValue<T>.init(scopedValue!)
139
- }
140
-
141
- return CanHavePlatformSpecificValue<T>.init(try self.decode(T.self, forKey: key))
142
- }
143
-
144
- func decode<T : Decodable>(_ type: CanHavePlatformSpecificValue<T?>.Type, forKey key: Key) throws -> CanHavePlatformSpecificValue<T?> {
145
- let scopedValue = decodedFromIOSSection(T.self, forKey: key)
146
- if scopedValue != nil {
147
- return CanHavePlatformSpecificValue<T?>.init(scopedValue)
148
- }
149
-
150
- return CanHavePlatformSpecificValue<T?>.init(try self.decodeIfPresent(T.self, forKey: key))
151
- }
152
-
153
- func decodedFromIOSSection<T: Decodable>(_ type: T.Type, forKey key: Key) -> T? {
154
- let iosSectionDecoder = try? superDecoder(forKey: .ios)
155
- let iosSectionConteiner = try? iosSectionDecoder?.container(keyedBy: Key.self)
156
- return try? iosSectionConteiner?.decodeIfPresent(T.self, forKey: key)
157
- }
158
- }