@thelacanians/vue-native-cli 0.4.15 → 0.6.2

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 (116) hide show
  1. package/dist/cli.js +329 -15
  2. package/native/android/VueNativeCore/src/main/kotlin/com/vuenative/core/Bridge/NativeBridge.kt +118 -0
  3. package/native/android/VueNativeCore/src/main/kotlin/com/vuenative/core/Components/Factories/VViewFactory.kt +178 -1
  4. package/native/android/VueNativeCore/src/main/kotlin/com/vuenative/core/Modules/GeneratedModuleRegistry.kt +28 -0
  5. package/native/android/VueNativeCore/src/main/kotlin/com/vuenative/core/Modules/NativeModuleRegistry.kt +3 -0
  6. package/native/android/VueNativeCore/src/test/kotlin/com/vuenative/core/ComponentFactoryTest.kt +674 -0
  7. package/native/android/VueNativeCore/src/test/kotlin/com/vuenative/core/ErrorOverlayViewTest.kt +183 -0
  8. package/native/android/VueNativeCore/src/test/kotlin/com/vuenative/core/EventThrottleTest.kt +203 -0
  9. package/native/android/VueNativeCore/src/test/kotlin/com/vuenative/core/HotReloadManagerTest.kt +162 -0
  10. package/native/android/VueNativeCore/src/test/kotlin/com/vuenative/core/JSPolyfillsTest.kt +153 -0
  11. package/native/android/VueNativeCore/src/test/kotlin/com/vuenative/core/NativeBridgeTest.kt +6 -3
  12. package/native/android/VueNativeCore/src/test/kotlin/com/vuenative/core/NativeModuleTest.kt +475 -0
  13. package/native/android/gradle.properties +1 -0
  14. package/native/android/gradlew +1 -1
  15. package/native/ios/VueNativeCore/Package.swift +1 -1
  16. package/native/ios/VueNativeCore/Sources/VueNativeCore/Bridge/EventThrottle.swift +1 -0
  17. package/native/ios/VueNativeCore/Sources/VueNativeCore/Bridge/NativeBridge.swift +143 -5
  18. package/native/ios/VueNativeCore/Sources/VueNativeCore/Components/Factories/VTextFactory.swift +43 -0
  19. package/native/ios/VueNativeCore/Sources/VueNativeCore/Components/Factories/VViewFactory.swift +116 -4
  20. package/native/ios/VueNativeCore/Sources/VueNativeCore/Helpers/GestureWrapper.swift +100 -0
  21. package/native/ios/VueNativeCore/Sources/VueNativeCore/Modules/GeneratedModuleRegistry.swift +28 -0
  22. package/native/ios/VueNativeCore/Sources/VueNativeCore/Modules/NativeModuleRegistry.swift +3 -0
  23. package/native/ios/VueNativeCore/Tests/VueNativeCoreTests/CertificatePinningTests.swift +190 -0
  24. package/native/ios/VueNativeCore/Tests/VueNativeCoreTests/ComponentFactoryTests.swift +585 -0
  25. package/native/ios/VueNativeCore/Tests/VueNativeCoreTests/EventThrottleTests.swift +161 -0
  26. package/native/ios/VueNativeCore/Tests/VueNativeCoreTests/HotReloadManagerTests.swift +88 -0
  27. package/native/ios/VueNativeCore/Tests/VueNativeCoreTests/JSPolyfillsTests.swift +319 -0
  28. package/native/ios/VueNativeCore/Tests/VueNativeCoreTests/NativeModuleTests.swift +400 -0
  29. package/native/macos/VueNativeMacOS/Package.swift +34 -0
  30. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Bridge/ErrorOverlayView.swift +112 -0
  31. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Bridge/EventThrottle.swift +58 -0
  32. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Bridge/HotReloadManager.swift +153 -0
  33. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Bridge/JSPolyfills.swift +696 -0
  34. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Bridge/JSRuntime.swift +347 -0
  35. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Bridge/NativeBridge.swift +877 -0
  36. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Bridge/VueNativeWindowController.swift +125 -0
  37. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/ComponentRegistry.swift +209 -0
  38. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VActionSheetFactory.swift +155 -0
  39. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VActivityIndicatorFactory.swift +85 -0
  40. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VAlertDialogFactory.swift +132 -0
  41. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VButtonFactory.swift +83 -0
  42. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VCheckboxFactory.swift +108 -0
  43. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VDropdownFactory.swift +155 -0
  44. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VImageFactory.swift +270 -0
  45. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VInputFactory.swift +257 -0
  46. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VKeyboardAvoidingFactory.swift +22 -0
  47. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VListFactory.swift +324 -0
  48. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VModalFactory.swift +231 -0
  49. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VOutlineViewFactory.swift +276 -0
  50. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VPickerFactory.swift +134 -0
  51. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VPressableFactory.swift +120 -0
  52. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VProgressBarFactory.swift +71 -0
  53. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VRadioFactory.swift +193 -0
  54. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VRefreshControlFactory.swift +25 -0
  55. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VSafeAreaFactory.swift +46 -0
  56. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VScrollViewFactory.swift +190 -0
  57. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VSectionListFactory.swift +374 -0
  58. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VSegmentedControlFactory.swift +125 -0
  59. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VSliderFactory.swift +131 -0
  60. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VSplitViewFactory.swift +215 -0
  61. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VStatusBarFactory.swift +25 -0
  62. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VSwitchFactory.swift +92 -0
  63. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VTextFactory.swift +336 -0
  64. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VToolbarFactory.swift +212 -0
  65. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VVideoFactory.swift +245 -0
  66. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VViewFactory.swift +314 -0
  67. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VWebViewFactory.swift +162 -0
  68. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/NativeComponentFactory.swift +54 -0
  69. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Helpers/ClickableView.swift +100 -0
  70. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Helpers/Extensions.swift +23 -0
  71. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Helpers/GestureWrapper.swift +183 -0
  72. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Helpers/NSColor+Hex.swift +78 -0
  73. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Layout/FlippedView.swift +19 -0
  74. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Layout/LayoutNode.swift +493 -0
  75. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Modules/AnimationModule.swift +354 -0
  76. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Modules/AppStateModule.swift +62 -0
  77. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Modules/BiometryModule.swift +60 -0
  78. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Modules/CameraModule.swift +167 -0
  79. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Modules/ClipboardModule.swift +34 -0
  80. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Modules/DeviceInfoModule.swift +49 -0
  81. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Modules/DragDropModule.swift +50 -0
  82. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Modules/FileDialogModule.swift +86 -0
  83. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Modules/HapticsModule.swift +42 -0
  84. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Modules/KeyboardModule.swift +28 -0
  85. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Modules/LinkingModule.swift +49 -0
  86. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Modules/MenuModule.swift +95 -0
  87. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Modules/NativeModuleRegistry.swift +63 -0
  88. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Modules/NotificationsModule.swift +112 -0
  89. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Modules/PermissionsModule.swift +149 -0
  90. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Modules/ShareModule.swift +37 -0
  91. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Modules/WindowModule.swift +71 -0
  92. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Resources/vue-native-placeholder.js +2 -0
  93. package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Styling/StyleEngine.swift +885 -0
  94. package/native/macos/VueNativeMacOS/Tests/VueNativeMacOSTests/ComponentFactoryTests.swift +80 -0
  95. package/native/macos/VueNativeMacOS/Tests/VueNativeMacOSTests/VueNativeMacOSTests.swift +149 -0
  96. package/native/shared/VueNativeShared/AGENTS.md +129 -0
  97. package/native/shared/VueNativeShared/Package.swift +14 -0
  98. package/native/shared/VueNativeShared/Sources/VueNativeShared/CertificatePinning.swift +134 -0
  99. package/native/shared/VueNativeShared/Sources/VueNativeShared/EventThrottle.swift +78 -0
  100. package/native/shared/VueNativeShared/Sources/VueNativeShared/HotReloadManager.swift +162 -0
  101. package/native/shared/VueNativeShared/Sources/VueNativeShared/JSRuntime.swift +412 -0
  102. package/native/shared/VueNativeShared/Sources/VueNativeShared/Modules/AsyncStorageModule.swift +68 -0
  103. package/native/shared/VueNativeShared/Sources/VueNativeShared/Modules/AudioModule.swift +359 -0
  104. package/native/shared/VueNativeShared/Sources/VueNativeShared/Modules/DatabaseModule.swift +259 -0
  105. package/native/shared/VueNativeShared/Sources/VueNativeShared/Modules/FileSystemModule.swift +233 -0
  106. package/native/shared/VueNativeShared/Sources/VueNativeShared/Modules/GeolocationModule.swift +156 -0
  107. package/native/shared/VueNativeShared/Sources/VueNativeShared/Modules/NetworkModule.swift +59 -0
  108. package/native/shared/VueNativeShared/Sources/VueNativeShared/Modules/PerformanceModule.swift +113 -0
  109. package/native/shared/VueNativeShared/Sources/VueNativeShared/Modules/SecureStorageModule.swift +119 -0
  110. package/native/shared/VueNativeShared/Sources/VueNativeShared/Modules/WebSocketModule.swift +212 -0
  111. package/native/shared/VueNativeShared/Sources/VueNativeShared/NativeEventDispatcher.swift +6 -0
  112. package/native/shared/VueNativeShared/Sources/VueNativeShared/NativeModule.swift +26 -0
  113. package/native/shared/VueNativeShared/Sources/VueNativeShared/NativeModuleRegistry.swift +37 -0
  114. package/native/shared/VueNativeShared/Sources/VueNativeShared/SharedJSPolyfills.swift +673 -0
  115. package/native/shared/VueNativeShared/Tests/VueNativeSharedTests/VueNativeSharedTests.swift +44 -0
  116. package/package.json +8 -2
@@ -0,0 +1,190 @@
1
+ #if canImport(UIKit)
2
+ import XCTest
3
+ import UIKit
4
+ @testable import VueNativeCore
5
+
6
+ @MainActor
7
+ final class CertificatePinningTests: XCTestCase {
8
+
9
+ // MARK: - Properties
10
+
11
+ private var pinning: CertificatePinning!
12
+
13
+ // MARK: - Setup / Teardown
14
+
15
+ override func setUp() {
16
+ super.setUp()
17
+ pinning = CertificatePinning.shared
18
+ pinning.clearPins()
19
+ }
20
+
21
+ override func tearDown() {
22
+ pinning.clearPins()
23
+ pinning = nil
24
+ super.tearDown()
25
+ }
26
+
27
+ // MARK: - Singleton Tests
28
+
29
+ func testSharedInstanceIsSingleton() {
30
+ let instance1 = CertificatePinning.shared
31
+ let instance2 = CertificatePinning.shared
32
+ XCTAssertTrue(instance1 === instance2, "CertificatePinning.shared should always return the same instance")
33
+ }
34
+
35
+ // MARK: - configurePins Tests
36
+
37
+ func testConfigurePinsStoresHashesForDomain() {
38
+ pinning.configurePins([
39
+ "api.example.com": ["sha256/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="]
40
+ ])
41
+
42
+ XCTAssertTrue(pinning.hasPins(for: "api.example.com"), "Should have pins for configured domain")
43
+ }
44
+
45
+ func testConfigurePinsMultipleDomains() {
46
+ pinning.configurePins([
47
+ "api.example.com": ["sha256/AAA="],
48
+ "cdn.example.com": ["sha256/BBB="]
49
+ ])
50
+
51
+ XCTAssertTrue(pinning.hasPins(for: "api.example.com"), "Should have pins for api.example.com")
52
+ XCTAssertTrue(pinning.hasPins(for: "cdn.example.com"), "Should have pins for cdn.example.com")
53
+ }
54
+
55
+ func testConfigurePinsMultipleHashesPerDomain() {
56
+ pinning.configurePins([
57
+ "api.example.com": ["sha256/PrimaryHash=", "sha256/BackupHash="]
58
+ ])
59
+
60
+ XCTAssertTrue(pinning.hasPins(for: "api.example.com"),
61
+ "Should have pins with multiple hashes")
62
+ }
63
+
64
+ func testConfigurePinsIgnoresMalformedPins() {
65
+ // Pins without "sha256/" prefix should be ignored
66
+ pinning.configurePins([
67
+ "api.example.com": ["md5/NotSupported"]
68
+ ])
69
+
70
+ XCTAssertFalse(pinning.hasPins(for: "api.example.com"),
71
+ "Malformed pins (without sha256/ prefix) should not register")
72
+ }
73
+
74
+ func testConfigurePinsIsCaseInsensitiveForDomain() {
75
+ pinning.configurePins([
76
+ "API.Example.COM": ["sha256/TestHash="]
77
+ ])
78
+
79
+ XCTAssertTrue(pinning.hasPins(for: "api.example.com"),
80
+ "Domain lookup should be case-insensitive")
81
+ }
82
+
83
+ // MARK: - hasPins Tests
84
+
85
+ func testHasPinsReturnsFalseForUnconfiguredDomain() {
86
+ XCTAssertFalse(pinning.hasPins(for: "unknown.com"),
87
+ "Should return false for domains without pins")
88
+ }
89
+
90
+ func testHasPinsReturnsTrueForConfiguredDomain() {
91
+ pinning.configurePins([
92
+ "example.com": ["sha256/TestHash="]
93
+ ])
94
+
95
+ XCTAssertTrue(pinning.hasPins(for: "example.com"),
96
+ "Should return true for configured domain")
97
+ }
98
+
99
+ func testHasPinsIsCaseInsensitive() {
100
+ pinning.configurePins([
101
+ "example.com": ["sha256/TestHash="]
102
+ ])
103
+
104
+ XCTAssertTrue(pinning.hasPins(for: "EXAMPLE.COM"),
105
+ "hasPins lookup should be case-insensitive")
106
+ }
107
+
108
+ // MARK: - clearPins Tests
109
+
110
+ func testClearPinsRemovesAllPins() {
111
+ pinning.configurePins([
112
+ "api.example.com": ["sha256/AAA="],
113
+ "cdn.example.com": ["sha256/BBB="]
114
+ ])
115
+
116
+ pinning.clearPins()
117
+
118
+ XCTAssertFalse(pinning.hasPins(for: "api.example.com"),
119
+ "clearPins should remove all configured pins")
120
+ XCTAssertFalse(pinning.hasPins(for: "cdn.example.com"),
121
+ "clearPins should remove all configured pins")
122
+ }
123
+
124
+ func testClearPinsOnEmptyDoesNotCrash() {
125
+ // Should not crash when called with no pins configured
126
+ pinning.clearPins()
127
+ }
128
+
129
+ // MARK: - Session Tests
130
+
131
+ func testSessionIsURLSession() {
132
+ let session = pinning.session
133
+ XCTAssertNotNil(session, "session should return a valid URLSession")
134
+ }
135
+
136
+ func testSessionIsSameInstance() {
137
+ let session1 = pinning.session
138
+ let session2 = pinning.session
139
+ XCTAssertTrue(session1 === session2, "session should return the same URLSession instance")
140
+ }
141
+
142
+ // MARK: - URLSessionDelegate Conformance
143
+
144
+ func testConformsToURLSessionDelegate() {
145
+ XCTAssertTrue(pinning is URLSessionDelegate,
146
+ "CertificatePinning should conform to URLSessionDelegate")
147
+ }
148
+
149
+ // MARK: - Empty Pins Allows Default Handling
150
+
151
+ func testNoPinsConfiguredAllowsDefaultHandling() {
152
+ // With no pins configured, hasPins should return false for any domain
153
+ XCTAssertFalse(pinning.hasPins(for: "anything.com"),
154
+ "Without pins configured, all domains should use default handling")
155
+ }
156
+
157
+ // MARK: - Backup Pin Support
158
+
159
+ func testBackupPinConfigured() {
160
+ // Configure primary + backup pins for a domain
161
+ pinning.configurePins([
162
+ "api.example.com": ["sha256/PrimaryHash=", "sha256/BackupHash="]
163
+ ])
164
+
165
+ // Both pins should be stored
166
+ XCTAssertTrue(pinning.hasPins(for: "api.example.com"),
167
+ "Domain should have pins configured including backup")
168
+ }
169
+
170
+ // MARK: - Additive Configuration
171
+
172
+ func testConfigurePinsIsAdditive() {
173
+ pinning.configurePins(["api.example.com": ["sha256/AAA="]])
174
+ pinning.configurePins(["cdn.example.com": ["sha256/BBB="]])
175
+
176
+ // First domain's pins may be overwritten or preserved depending on implementation.
177
+ // At minimum, the second domain should be configured.
178
+ XCTAssertTrue(pinning.hasPins(for: "cdn.example.com"),
179
+ "Adding pins for a new domain should work")
180
+ }
181
+
182
+ func testConfigurePinsSameDomainOverwrites() {
183
+ pinning.configurePins(["api.example.com": ["sha256/OldHash="]])
184
+ pinning.configurePins(["api.example.com": ["sha256/NewHash="]])
185
+
186
+ XCTAssertTrue(pinning.hasPins(for: "api.example.com"),
187
+ "Reconfiguring the same domain should still have pins")
188
+ }
189
+ }
190
+ #endif