@cappitolian/network-discovery 0.0.10 → 0.0.12
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/Package.swift +27 -27
- package/README.md +364 -364
- package/android/src/main/java/com/cappitolian/plugins/networkdiscovery/NetworkDiscovery.java +4 -12
- package/android/src/main/java/com/cappitolian/plugins/networkdiscovery/NetworkDiscoveryPlugin.java +115 -128
- package/ios/Sources/NetworkDiscoveryPlugin/NetworkDiscoveryPlugin.swift +103 -74
- package/package.json +85 -85
package/android/src/main/java/com/cappitolian/plugins/networkdiscovery/NetworkDiscovery.java
CHANGED
|
@@ -132,20 +132,12 @@ public class NetworkDiscovery {
|
|
|
132
132
|
|
|
133
133
|
@Override
|
|
134
134
|
public void onServiceResolved(NsdServiceInfo serviceInfo) {
|
|
135
|
-
Log.d(TAG, "
|
|
136
|
-
|
|
137
|
-
Log.d(TAG, " Host: " + (serviceInfo.getHost() != null ? serviceInfo.getHost().getHostAddress() : "null"));
|
|
138
|
-
Log.d(TAG, " Port: " + serviceInfo.getPort());
|
|
139
|
-
|
|
135
|
+
Log.d(TAG, "Service resolved: " + serviceInfo);
|
|
136
|
+
|
|
140
137
|
JSObject serviceData = buildServiceObject(serviceInfo);
|
|
141
|
-
|
|
142
|
-
Log.d(TAG, "Android: Calling callback.onServiceFound with data: " + serviceData.toString());
|
|
143
|
-
|
|
144
138
|
callback.onServiceFound(serviceData);
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}
|
|
148
|
-
});
|
|
139
|
+
}
|
|
140
|
+
});
|
|
149
141
|
}
|
|
150
142
|
|
|
151
143
|
@Override
|
package/android/src/main/java/com/cappitolian/plugins/networkdiscovery/NetworkDiscoveryPlugin.java
CHANGED
|
@@ -1,129 +1,116 @@
|
|
|
1
|
-
package com.cappitolian.plugins.networkdiscovery;
|
|
2
|
-
|
|
3
|
-
import com.getcapacitor.JSObject;
|
|
4
|
-
import com.getcapacitor.Plugin;
|
|
5
|
-
import com.getcapacitor.PluginCall;
|
|
6
|
-
import com.getcapacitor.PluginMethod;
|
|
7
|
-
import com.getcapacitor.annotation.CapacitorPlugin;
|
|
8
|
-
|
|
9
|
-
@CapacitorPlugin(name = "NetworkDiscovery")
|
|
10
|
-
public class NetworkDiscoveryPlugin extends Plugin {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
String
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
@Override
|
|
117
|
-
public void onSuccess() {
|
|
118
|
-
JSObject ret = new JSObject();
|
|
119
|
-
ret.put("success", true);
|
|
120
|
-
call.resolve(ret);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
@Override
|
|
124
|
-
public void onError(String error) {
|
|
125
|
-
call.reject(error);
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
}
|
|
1
|
+
package com.cappitolian.plugins.networkdiscovery;
|
|
2
|
+
|
|
3
|
+
import com.getcapacitor.JSObject;
|
|
4
|
+
import com.getcapacitor.Plugin;
|
|
5
|
+
import com.getcapacitor.PluginCall;
|
|
6
|
+
import com.getcapacitor.PluginMethod;
|
|
7
|
+
import com.getcapacitor.annotation.CapacitorPlugin;
|
|
8
|
+
|
|
9
|
+
@CapacitorPlugin(name = "NetworkDiscovery")
|
|
10
|
+
public class NetworkDiscoveryPlugin extends Plugin {
|
|
11
|
+
private NetworkDiscovery implementation;
|
|
12
|
+
|
|
13
|
+
@Override
|
|
14
|
+
public void load() {
|
|
15
|
+
implementation = new NetworkDiscovery(this, getContext());
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@PluginMethod
|
|
19
|
+
public void startAdvertising(PluginCall call) {
|
|
20
|
+
String serviceName = call.getString("serviceName");
|
|
21
|
+
String serviceType = call.getString("serviceType");
|
|
22
|
+
Integer port = call.getInt("port");
|
|
23
|
+
JSObject txtRecord = call.getObject("txtRecord");
|
|
24
|
+
|
|
25
|
+
if (serviceName == null || serviceType == null || port == null) {
|
|
26
|
+
call.reject("Missing required parameters");
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
implementation.startAdvertising(
|
|
31
|
+
serviceName,
|
|
32
|
+
serviceType,
|
|
33
|
+
port,
|
|
34
|
+
txtRecord,
|
|
35
|
+
new NetworkDiscovery.AdvertisingCallback() {
|
|
36
|
+
@Override
|
|
37
|
+
public void onSuccess() {
|
|
38
|
+
JSObject ret = new JSObject();
|
|
39
|
+
ret.put("success", true);
|
|
40
|
+
call.resolve(ret);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@Override
|
|
44
|
+
public void onError(String error) {
|
|
45
|
+
call.reject(error);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@PluginMethod
|
|
52
|
+
public void stopAdvertising(PluginCall call) {
|
|
53
|
+
implementation.stopAdvertising(new NetworkDiscovery.StopCallback() {
|
|
54
|
+
@Override
|
|
55
|
+
public void onSuccess() {
|
|
56
|
+
JSObject ret = new JSObject();
|
|
57
|
+
ret.put("success", true);
|
|
58
|
+
call.resolve(ret);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@Override
|
|
62
|
+
public void onError(String error) {
|
|
63
|
+
call.reject(error);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@PluginMethod
|
|
69
|
+
public void startDiscovery(PluginCall call) {
|
|
70
|
+
String serviceType = call.getString("serviceType");
|
|
71
|
+
|
|
72
|
+
if (serviceType == null) {
|
|
73
|
+
call.reject("Missing serviceType parameter");
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
implementation.startDiscovery(serviceType, new NetworkDiscovery.DiscoveryCallback() {
|
|
78
|
+
@Override
|
|
79
|
+
public void onDiscoveryStarted() {
|
|
80
|
+
call.resolve();
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
@Override
|
|
84
|
+
public void onServiceFound(JSObject service) {
|
|
85
|
+
notifyListeners("serviceFound", service);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
@Override
|
|
89
|
+
public void onServiceLost(JSObject service) {
|
|
90
|
+
notifyListeners("serviceLost", service);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
@Override
|
|
94
|
+
public void onError(String error) {
|
|
95
|
+
call.reject(error);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
@PluginMethod
|
|
101
|
+
public void stopDiscovery(PluginCall call) {
|
|
102
|
+
implementation.stopDiscovery(new NetworkDiscovery.StopCallback() {
|
|
103
|
+
@Override
|
|
104
|
+
public void onSuccess() {
|
|
105
|
+
JSObject ret = new JSObject();
|
|
106
|
+
ret.put("success", true);
|
|
107
|
+
call.resolve(ret);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
@Override
|
|
111
|
+
public void onError(String error) {
|
|
112
|
+
call.reject(error);
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
}
|
|
129
116
|
}
|
|
@@ -1,75 +1,104 @@
|
|
|
1
|
-
import Foundation
|
|
2
|
-
import Capacitor
|
|
3
|
-
|
|
4
|
-
@objc(NetworkDiscoveryPlugin)
|
|
5
|
-
public class NetworkDiscoveryPlugin: CAPPlugin, NetworkDiscoveryDelegate {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
implementation
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
1
|
+
import Foundation
|
|
2
|
+
import Capacitor
|
|
3
|
+
|
|
4
|
+
@objc(NetworkDiscoveryPlugin)
|
|
5
|
+
public class NetworkDiscoveryPlugin: CAPPlugin, CAPBridgedPlugin, NetworkDiscoveryDelegate {
|
|
6
|
+
|
|
7
|
+
// MARK: - CAPBridgedPlugin Properties
|
|
8
|
+
public let identifier = "NetworkDiscoveryPlugin"
|
|
9
|
+
public let jsName = "NetworkDiscovery"
|
|
10
|
+
public let pluginMethods: [CAPPluginMethod] = [
|
|
11
|
+
CAPPluginMethod(name: "startAdvertising", returnType: CAPPluginReturnPromise),
|
|
12
|
+
CAPPluginMethod(name: "stopAdvertising", returnType: CAPPluginReturnPromise),
|
|
13
|
+
CAPPluginMethod(name: "startDiscovery", returnType: CAPPluginReturnPromise),
|
|
14
|
+
CAPPluginMethod(name: "stopDiscovery", returnType: CAPPluginReturnPromise)
|
|
15
|
+
]
|
|
16
|
+
|
|
17
|
+
// MARK: - Properties
|
|
18
|
+
private var implementation: NetworkDiscovery?
|
|
19
|
+
|
|
20
|
+
// MARK: - Lifecycle
|
|
21
|
+
public override func load() {
|
|
22
|
+
print("✅ NetworkDiscoveryPlugin: Plugin loaded")
|
|
23
|
+
implementation = NetworkDiscovery()
|
|
24
|
+
implementation?.delegate = self
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// MARK: - Plugin Methods
|
|
28
|
+
@objc func startAdvertising(_ call: CAPPluginCall) {
|
|
29
|
+
print("📞 NetworkDiscoveryPlugin: startAdvertising() called")
|
|
30
|
+
|
|
31
|
+
guard let serviceName = call.getString("serviceName"),
|
|
32
|
+
let serviceType = call.getString("serviceType"),
|
|
33
|
+
let port = call.getInt("port") else {
|
|
34
|
+
call.reject("Missing required parameters")
|
|
35
|
+
return
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
let txtRecord = call.getObject("txtRecord") as? [String: String]
|
|
39
|
+
|
|
40
|
+
print("📡 NetworkDiscoveryPlugin: Starting advertising - \(serviceName)")
|
|
41
|
+
|
|
42
|
+
implementation?.startAdvertising(
|
|
43
|
+
serviceName: serviceName,
|
|
44
|
+
serviceType: serviceType,
|
|
45
|
+
port: port,
|
|
46
|
+
txtRecord: txtRecord
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
call.resolve(["success": true])
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@objc func stopAdvertising(_ call: CAPPluginCall) {
|
|
53
|
+
print("📞 NetworkDiscoveryPlugin: stopAdvertising() called")
|
|
54
|
+
implementation?.stopAdvertising()
|
|
55
|
+
call.resolve(["success": true])
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@objc func startDiscovery(_ call: CAPPluginCall) {
|
|
59
|
+
print("📞 NetworkDiscoveryPlugin: startDiscovery() called")
|
|
60
|
+
|
|
61
|
+
guard let serviceType = call.getString("serviceType") else {
|
|
62
|
+
call.reject("Missing serviceType parameter")
|
|
63
|
+
return
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
let domain = call.getString("domain") ?? "local."
|
|
67
|
+
|
|
68
|
+
print("🔍 NetworkDiscoveryPlugin: Starting discovery for \(serviceType)")
|
|
69
|
+
|
|
70
|
+
implementation?.startDiscovery(serviceType: serviceType, domain: domain)
|
|
71
|
+
call.resolve()
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@objc func stopDiscovery(_ call: CAPPluginCall) {
|
|
75
|
+
print("📞 NetworkDiscoveryPlugin: stopDiscovery() called")
|
|
76
|
+
implementation?.stopDiscovery()
|
|
77
|
+
call.resolve(["success": true])
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// MARK: - NetworkDiscoveryDelegate
|
|
81
|
+
public func advertisingDidStart() {
|
|
82
|
+
print("✅ NetworkDiscoveryPlugin: Advertising started successfully")
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
public func advertisingDidFail(error: String) {
|
|
86
|
+
print("❌ NetworkDiscoveryPlugin: Advertising failed - \(error)")
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
public func serviceFound(serviceData: [String : Any]) {
|
|
90
|
+
print("📨 NetworkDiscoveryPlugin: Service found, notifying listeners")
|
|
91
|
+
print(" Service data: \(serviceData)")
|
|
92
|
+
notifyListeners("serviceFound", data: serviceData)
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
public func serviceLost(serviceData: [String : Any]) {
|
|
96
|
+
print("📨 NetworkDiscoveryPlugin: Service lost, notifying listeners")
|
|
97
|
+
print(" Service data: \(serviceData)")
|
|
98
|
+
notifyListeners("serviceLost", data: serviceData)
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
public func discoveryDidFail(error: String) {
|
|
102
|
+
print("❌ NetworkDiscoveryPlugin: Discovery failed - \(error)")
|
|
103
|
+
}
|
|
75
104
|
}
|
package/package.json
CHANGED
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@cappitolian/network-discovery",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "A Capacitor plugin for network service discovery using mDNS/Bonjour. Allows automatic server-client connection without manual IP configuration.",
|
|
5
|
-
"main": "dist/plugin.cjs.js",
|
|
6
|
-
"module": "dist/esm/index.js",
|
|
7
|
-
"types": "dist/esm/index.d.ts",
|
|
8
|
-
"unpkg": "dist/plugin.js",
|
|
9
|
-
"files": [
|
|
10
|
-
"android/src/main/",
|
|
11
|
-
"android/build.gradle",
|
|
12
|
-
"dist/",
|
|
13
|
-
"ios/Sources",
|
|
14
|
-
"ios/Tests",
|
|
15
|
-
"Package.swift",
|
|
16
|
-
"CappitolianNetworkDiscovery.podspec"
|
|
17
|
-
],
|
|
18
|
-
"author": "Cappitolian",
|
|
19
|
-
"license": "MIT",
|
|
20
|
-
"repository": {
|
|
21
|
-
"type": "git",
|
|
22
|
-
"url": "git+https://github.com/alessandrycruz1987/network-discovery.git"
|
|
23
|
-
},
|
|
24
|
-
"bugs": {
|
|
25
|
-
"url": "https://github.com/alessandrycruz1987/network-discovery.git/issues"
|
|
26
|
-
},
|
|
27
|
-
"keywords": [
|
|
28
|
-
"capacitor",
|
|
29
|
-
"plugin",
|
|
30
|
-
"native",
|
|
31
|
-
"network",
|
|
32
|
-
"discovery",
|
|
33
|
-
"mdns",
|
|
34
|
-
"bonjour",
|
|
35
|
-
"nsd",
|
|
36
|
-
"zeroconf"
|
|
37
|
-
],
|
|
38
|
-
"scripts": {
|
|
39
|
-
"verify": "npm run verify:ios && npm run verify:android && npm run verify:web",
|
|
40
|
-
"verify:ios": "xcodebuild -scheme CappitolianNetworkDiscovery -destination generic/platform=iOS",
|
|
41
|
-
"verify:android": "cd android && ./gradlew clean build test && cd ..",
|
|
42
|
-
"verify:web": "npm run build",
|
|
43
|
-
"lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
|
|
44
|
-
"fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format",
|
|
45
|
-
"eslint": "eslint . --ext ts",
|
|
46
|
-
"prettier": "prettier \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java",
|
|
47
|
-
"swiftlint": "node-swiftlint",
|
|
48
|
-
"docgen": "docgen --api NetworkDiscoveryPlugin --output-readme README.md --output-json dist/docs.json",
|
|
49
|
-
"build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs",
|
|
50
|
-
"clean": "rimraf ./dist",
|
|
51
|
-
"watch": "tsc --watch",
|
|
52
|
-
"prepublishOnly": "npm run build"
|
|
53
|
-
},
|
|
54
|
-
"devDependencies": {
|
|
55
|
-
"@capacitor/android": "^7.
|
|
56
|
-
"@capacitor/core": "^7.
|
|
57
|
-
"@capacitor/docgen": "^0.3.1",
|
|
58
|
-
"@capacitor/ios": "^7.
|
|
59
|
-
"@ionic/eslint-config": "^0.4.0",
|
|
60
|
-
"@ionic/prettier-config": "^4.0.0",
|
|
61
|
-
"@ionic/swiftlint-config": "^2.0.0",
|
|
62
|
-
"eslint": "^8.57.1",
|
|
63
|
-
"prettier": "^3.6.2",
|
|
64
|
-
"prettier-plugin-java": "^2.7.7",
|
|
65
|
-
"rimraf": "^6.1.0",
|
|
66
|
-
"rollup": "^4.53.2",
|
|
67
|
-
"swiftlint": "^2.0.0",
|
|
68
|
-
"typescript": "^5.9.3"
|
|
69
|
-
},
|
|
70
|
-
"peerDependencies": {
|
|
71
|
-
"@capacitor/core": "
|
|
72
|
-
},
|
|
73
|
-
"prettier": "@ionic/prettier-config",
|
|
74
|
-
"swiftlint": "@ionic/swiftlint-config",
|
|
75
|
-
"eslintConfig": {
|
|
76
|
-
"extends": "@ionic/eslint-config/recommended"
|
|
77
|
-
},
|
|
78
|
-
"capacitor": {
|
|
79
|
-
"ios": {
|
|
80
|
-
"src": "ios"
|
|
81
|
-
},
|
|
82
|
-
"android": {
|
|
83
|
-
"src": "android"
|
|
84
|
-
}
|
|
85
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@cappitolian/network-discovery",
|
|
3
|
+
"version": "0.0.12",
|
|
4
|
+
"description": "A Capacitor plugin for network service discovery using mDNS/Bonjour. Allows automatic server-client connection without manual IP configuration.",
|
|
5
|
+
"main": "dist/plugin.cjs.js",
|
|
6
|
+
"module": "dist/esm/index.js",
|
|
7
|
+
"types": "dist/esm/index.d.ts",
|
|
8
|
+
"unpkg": "dist/plugin.js",
|
|
9
|
+
"files": [
|
|
10
|
+
"android/src/main/",
|
|
11
|
+
"android/build.gradle",
|
|
12
|
+
"dist/",
|
|
13
|
+
"ios/Sources",
|
|
14
|
+
"ios/Tests",
|
|
15
|
+
"Package.swift",
|
|
16
|
+
"CappitolianNetworkDiscovery.podspec"
|
|
17
|
+
],
|
|
18
|
+
"author": "Cappitolian",
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/alessandrycruz1987/network-discovery.git"
|
|
23
|
+
},
|
|
24
|
+
"bugs": {
|
|
25
|
+
"url": "https://github.com/alessandrycruz1987/network-discovery.git/issues"
|
|
26
|
+
},
|
|
27
|
+
"keywords": [
|
|
28
|
+
"capacitor",
|
|
29
|
+
"plugin",
|
|
30
|
+
"native",
|
|
31
|
+
"network",
|
|
32
|
+
"discovery",
|
|
33
|
+
"mdns",
|
|
34
|
+
"bonjour",
|
|
35
|
+
"nsd",
|
|
36
|
+
"zeroconf"
|
|
37
|
+
],
|
|
38
|
+
"scripts": {
|
|
39
|
+
"verify": "npm run verify:ios && npm run verify:android && npm run verify:web",
|
|
40
|
+
"verify:ios": "xcodebuild -scheme CappitolianNetworkDiscovery -destination generic/platform=iOS",
|
|
41
|
+
"verify:android": "cd android && ./gradlew clean build test && cd ..",
|
|
42
|
+
"verify:web": "npm run build",
|
|
43
|
+
"lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
|
|
44
|
+
"fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format",
|
|
45
|
+
"eslint": "eslint . --ext ts",
|
|
46
|
+
"prettier": "prettier \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java",
|
|
47
|
+
"swiftlint": "node-swiftlint",
|
|
48
|
+
"docgen": "docgen --api NetworkDiscoveryPlugin --output-readme README.md --output-json dist/docs.json",
|
|
49
|
+
"build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs",
|
|
50
|
+
"clean": "rimraf ./dist",
|
|
51
|
+
"watch": "tsc --watch",
|
|
52
|
+
"prepublishOnly": "npm run build"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@capacitor/android": "^7.4.5",
|
|
56
|
+
"@capacitor/core": "^7.4.5",
|
|
57
|
+
"@capacitor/docgen": "^0.3.1",
|
|
58
|
+
"@capacitor/ios": "^7.4.5",
|
|
59
|
+
"@ionic/eslint-config": "^0.4.0",
|
|
60
|
+
"@ionic/prettier-config": "^4.0.0",
|
|
61
|
+
"@ionic/swiftlint-config": "^2.0.0",
|
|
62
|
+
"eslint": "^8.57.1",
|
|
63
|
+
"prettier": "^3.6.2",
|
|
64
|
+
"prettier-plugin-java": "^2.7.7",
|
|
65
|
+
"rimraf": "^6.1.0",
|
|
66
|
+
"rollup": "^4.53.2",
|
|
67
|
+
"swiftlint": "^2.0.0",
|
|
68
|
+
"typescript": "^5.9.3"
|
|
69
|
+
},
|
|
70
|
+
"peerDependencies": {
|
|
71
|
+
"@capacitor/core": ">=7.0.0"
|
|
72
|
+
},
|
|
73
|
+
"prettier": "@ionic/prettier-config",
|
|
74
|
+
"swiftlint": "@ionic/swiftlint-config",
|
|
75
|
+
"eslintConfig": {
|
|
76
|
+
"extends": "@ionic/eslint-config/recommended"
|
|
77
|
+
},
|
|
78
|
+
"capacitor": {
|
|
79
|
+
"ios": {
|
|
80
|
+
"src": "ios"
|
|
81
|
+
},
|
|
82
|
+
"android": {
|
|
83
|
+
"src": "android"
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
86
|
}
|