@thelacanians/vue-native-cli 0.4.15 → 0.6.0
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.
- package/dist/cli.js +329 -15
- package/native/android/VueNativeCore/src/main/kotlin/com/vuenative/core/Bridge/NativeBridge.kt +118 -0
- package/native/android/VueNativeCore/src/main/kotlin/com/vuenative/core/Components/Factories/VViewFactory.kt +178 -1
- package/native/android/VueNativeCore/src/main/kotlin/com/vuenative/core/Modules/GeneratedModuleRegistry.kt +28 -0
- package/native/android/VueNativeCore/src/main/kotlin/com/vuenative/core/Modules/NativeModuleRegistry.kt +3 -0
- package/native/android/VueNativeCore/src/test/kotlin/com/vuenative/core/ComponentFactoryTest.kt +674 -0
- package/native/android/VueNativeCore/src/test/kotlin/com/vuenative/core/ErrorOverlayViewTest.kt +183 -0
- package/native/android/VueNativeCore/src/test/kotlin/com/vuenative/core/EventThrottleTest.kt +203 -0
- package/native/android/VueNativeCore/src/test/kotlin/com/vuenative/core/HotReloadManagerTest.kt +162 -0
- package/native/android/VueNativeCore/src/test/kotlin/com/vuenative/core/JSPolyfillsTest.kt +153 -0
- package/native/android/VueNativeCore/src/test/kotlin/com/vuenative/core/NativeBridgeTest.kt +6 -3
- package/native/android/VueNativeCore/src/test/kotlin/com/vuenative/core/NativeModuleTest.kt +475 -0
- package/native/android/gradle.properties +1 -0
- package/native/android/gradlew +1 -1
- package/native/ios/VueNativeCore/Package.swift +1 -1
- package/native/ios/VueNativeCore/Sources/VueNativeCore/Bridge/EventThrottle.swift +1 -0
- package/native/ios/VueNativeCore/Sources/VueNativeCore/Bridge/NativeBridge.swift +143 -5
- package/native/ios/VueNativeCore/Sources/VueNativeCore/Components/Factories/VTextFactory.swift +43 -0
- package/native/ios/VueNativeCore/Sources/VueNativeCore/Components/Factories/VViewFactory.swift +116 -4
- package/native/ios/VueNativeCore/Sources/VueNativeCore/Helpers/GestureWrapper.swift +100 -0
- package/native/ios/VueNativeCore/Sources/VueNativeCore/Modules/GeneratedModuleRegistry.swift +28 -0
- package/native/ios/VueNativeCore/Sources/VueNativeCore/Modules/NativeModuleRegistry.swift +3 -0
- package/native/ios/VueNativeCore/Tests/VueNativeCoreTests/CertificatePinningTests.swift +190 -0
- package/native/ios/VueNativeCore/Tests/VueNativeCoreTests/ComponentFactoryTests.swift +585 -0
- package/native/ios/VueNativeCore/Tests/VueNativeCoreTests/EventThrottleTests.swift +161 -0
- package/native/ios/VueNativeCore/Tests/VueNativeCoreTests/HotReloadManagerTests.swift +88 -0
- package/native/ios/VueNativeCore/Tests/VueNativeCoreTests/JSPolyfillsTests.swift +319 -0
- package/native/ios/VueNativeCore/Tests/VueNativeCoreTests/NativeModuleTests.swift +400 -0
- package/native/macos/VueNativeMacOS/Package.swift +34 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Bridge/ErrorOverlayView.swift +112 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Bridge/EventThrottle.swift +58 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Bridge/HotReloadManager.swift +153 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Bridge/JSPolyfills.swift +696 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Bridge/JSRuntime.swift +347 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Bridge/NativeBridge.swift +877 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Bridge/VueNativeWindowController.swift +125 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/ComponentRegistry.swift +209 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VActionSheetFactory.swift +155 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VActivityIndicatorFactory.swift +85 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VAlertDialogFactory.swift +132 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VButtonFactory.swift +83 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VCheckboxFactory.swift +108 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VDropdownFactory.swift +155 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VImageFactory.swift +270 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VInputFactory.swift +257 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VKeyboardAvoidingFactory.swift +22 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VListFactory.swift +324 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VModalFactory.swift +231 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VOutlineViewFactory.swift +276 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VPickerFactory.swift +134 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VPressableFactory.swift +120 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VProgressBarFactory.swift +71 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VRadioFactory.swift +193 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VRefreshControlFactory.swift +25 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VSafeAreaFactory.swift +46 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VScrollViewFactory.swift +190 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VSectionListFactory.swift +374 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VSegmentedControlFactory.swift +125 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VSliderFactory.swift +131 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VSplitViewFactory.swift +215 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VStatusBarFactory.swift +25 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VSwitchFactory.swift +92 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VTextFactory.swift +336 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VToolbarFactory.swift +212 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VVideoFactory.swift +245 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VViewFactory.swift +314 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/Factories/VWebViewFactory.swift +162 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Components/NativeComponentFactory.swift +54 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Helpers/ClickableView.swift +100 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Helpers/Extensions.swift +23 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Helpers/GestureWrapper.swift +183 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Helpers/NSColor+Hex.swift +78 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Layout/FlippedView.swift +19 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Layout/LayoutNode.swift +493 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Modules/AnimationModule.swift +354 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Modules/AppStateModule.swift +62 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Modules/BiometryModule.swift +60 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Modules/CameraModule.swift +167 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Modules/ClipboardModule.swift +34 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Modules/DeviceInfoModule.swift +49 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Modules/DragDropModule.swift +50 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Modules/FileDialogModule.swift +86 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Modules/HapticsModule.swift +42 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Modules/KeyboardModule.swift +28 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Modules/LinkingModule.swift +49 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Modules/MenuModule.swift +95 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Modules/NativeModuleRegistry.swift +63 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Modules/NotificationsModule.swift +112 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Modules/PermissionsModule.swift +149 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Modules/ShareModule.swift +37 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Modules/WindowModule.swift +71 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Resources/vue-native-placeholder.js +2 -0
- package/native/macos/VueNativeMacOS/Sources/VueNativeMacOS/Styling/StyleEngine.swift +885 -0
- package/native/macos/VueNativeMacOS/Tests/VueNativeMacOSTests/ComponentFactoryTests.swift +80 -0
- package/native/macos/VueNativeMacOS/Tests/VueNativeMacOSTests/VueNativeMacOSTests.swift +149 -0
- package/native/shared/VueNativeShared/AGENTS.md +129 -0
- package/native/shared/VueNativeShared/Package.swift +14 -0
- package/native/shared/VueNativeShared/Sources/VueNativeShared/CertificatePinning.swift +134 -0
- package/native/shared/VueNativeShared/Sources/VueNativeShared/EventThrottle.swift +78 -0
- package/native/shared/VueNativeShared/Sources/VueNativeShared/HotReloadManager.swift +162 -0
- package/native/shared/VueNativeShared/Sources/VueNativeShared/JSRuntime.swift +412 -0
- package/native/shared/VueNativeShared/Sources/VueNativeShared/Modules/AsyncStorageModule.swift +68 -0
- package/native/shared/VueNativeShared/Sources/VueNativeShared/Modules/AudioModule.swift +359 -0
- package/native/shared/VueNativeShared/Sources/VueNativeShared/Modules/DatabaseModule.swift +259 -0
- package/native/shared/VueNativeShared/Sources/VueNativeShared/Modules/FileSystemModule.swift +233 -0
- package/native/shared/VueNativeShared/Sources/VueNativeShared/Modules/GeolocationModule.swift +156 -0
- package/native/shared/VueNativeShared/Sources/VueNativeShared/Modules/NetworkModule.swift +59 -0
- package/native/shared/VueNativeShared/Sources/VueNativeShared/Modules/PerformanceModule.swift +113 -0
- package/native/shared/VueNativeShared/Sources/VueNativeShared/Modules/SecureStorageModule.swift +119 -0
- package/native/shared/VueNativeShared/Sources/VueNativeShared/Modules/WebSocketModule.swift +212 -0
- package/native/shared/VueNativeShared/Sources/VueNativeShared/NativeEventDispatcher.swift +6 -0
- package/native/shared/VueNativeShared/Sources/VueNativeShared/NativeModule.swift +26 -0
- package/native/shared/VueNativeShared/Sources/VueNativeShared/NativeModuleRegistry.swift +37 -0
- package/native/shared/VueNativeShared/Sources/VueNativeShared/SharedJSPolyfills.swift +673 -0
- package/native/shared/VueNativeShared/Tests/VueNativeSharedTests/VueNativeSharedTests.swift +44 -0
- 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
|