@capacitor/network 8.0.0-dev-2434-20251110T164702.0 → 8.0.0-dev-2444-20251112T191749.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/Package.swift +1 -1
- package/android/src/main/java/com/capacitorjs/plugins/network/NetworkPlugin.java +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/web.js +1 -3
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +2 -4
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +2 -4
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/NetworkPlugin/Reachability.swift +1 -1
- package/package.json +5 -5
package/Package.swift
CHANGED
|
@@ -10,7 +10,7 @@ let package = Package(
|
|
|
10
10
|
targets: ["CAPNetworkPlugin"])
|
|
11
11
|
],
|
|
12
12
|
dependencies: [
|
|
13
|
-
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "
|
|
13
|
+
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "7.0.0")
|
|
14
14
|
],
|
|
15
15
|
targets: [
|
|
16
16
|
.target(
|
|
@@ -21,7 +21,7 @@ public class NetworkPlugin extends Plugin {
|
|
|
21
21
|
@Override
|
|
22
22
|
public void load() {
|
|
23
23
|
implementation = new Network(getContext());
|
|
24
|
-
Network.NetworkStatusChangeListener listener = wasLostEvent -> {
|
|
24
|
+
Network.NetworkStatusChangeListener listener = (wasLostEvent) -> {
|
|
25
25
|
if (wasLostEvent) {
|
|
26
26
|
JSObject jsObject = new JSObject();
|
|
27
27
|
jsObject.put("connected", false);
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { registerPlugin } from '@capacitor/core';
|
|
2
2
|
const Network = registerPlugin('Network', {
|
|
3
|
-
web: () => import('./web').then(m => new m.NetworkWeb()),
|
|
3
|
+
web: () => import('./web').then((m) => new m.NetworkWeb()),
|
|
4
4
|
});
|
|
5
5
|
export * from './definitions';
|
|
6
6
|
export { Network };
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,OAAO,GAAG,cAAc,CAAgB,SAAS,EAAE;IACvD,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,OAAO,GAAG,cAAc,CAAgB,SAAS,EAAE;IACvD,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;CAC3D,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { NetworkPlugin } from './definitions';\n\nconst Network = registerPlugin<NetworkPlugin>('Network', {\n web: () => import('./web').then((m) => new m.NetworkWeb()),\n});\n\nexport * from './definitions';\nexport { Network };\n"]}
|
package/dist/esm/web.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { WebPlugin } from '@capacitor/core';
|
|
2
2
|
function translatedConnection() {
|
|
3
|
-
const connection = window.navigator.connection ||
|
|
4
|
-
window.navigator.mozConnection ||
|
|
5
|
-
window.navigator.webkitConnection;
|
|
3
|
+
const connection = window.navigator.connection || window.navigator.mozConnection || window.navigator.webkitConnection;
|
|
6
4
|
let result = 'unknown';
|
|
7
5
|
const type = connection ? connection.type || connection.effectiveType : null;
|
|
8
6
|
if (type && typeof type === 'string') {
|
package/dist/esm/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAY5C,SAAS,oBAAoB;IAC3B,MAAM,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC,UAAU,IAAI,MAAM,CAAC,SAAS,CAAC,aAAa,IAAI,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC;IACtH,IAAI,MAAM,GAAmB,SAAS,CAAC;IACvC,MAAM,IAAI,GAAG,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,IAAI,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC;IAC7E,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QACpC,QAAQ,IAAI,EAAE;YACZ,uBAAuB;YACvB,KAAK,WAAW,CAAC;YACjB,KAAK,UAAU;gBACb,MAAM,GAAG,UAAU,CAAC;gBACpB,MAAM;YACR,KAAK,MAAM;gBACT,MAAM,GAAG,MAAM,CAAC;gBAChB,MAAM;YACR,KAAK,UAAU,CAAC;YAChB,KAAK,MAAM,CAAC;YACZ,KAAK,OAAO;gBACV,MAAM,GAAG,MAAM,CAAC;gBAChB,MAAM;YACR,KAAK,OAAO,CAAC;YACb,KAAK,SAAS;gBACZ,MAAM,GAAG,SAAS,CAAC;gBACnB,MAAM;YACR,gCAAgC;YAChC,KAAK,SAAS,CAAC;YACf,KAAK,IAAI,CAAC;YACV,KAAK,IAAI;gBACP,MAAM,GAAG,UAAU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O,MAAM,CAAC;IAChB,CAAC;CAqBF;AAED,MAAM,OAAO,GAAG,IAAI,UAAU,EAAE,CAAC;AAEjC,OAAO,EAAE,OAAO,EAAE,CAAC","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type { ConnectionStatus, ConnectionType, NetworkPlugin } from './definitions';\n\ndeclare global {\n interface Navigator {\n connection: any;\n mozConnection: any;\n webkitConnection: any;\n }\n}\n\nfunction translatedConnection(): ConnectionType {\n const connection = window.navigator.connection || window.navigator.mozConnection || window.navigator.webkitConnection;\n let result: ConnectionType = 'unknown';\n const type = connection ? connection.type || connection.effectiveType : null;\n if (type && typeof type === 'string') {\n switch (type) {\n // possible type values\n case 'bluetooth':\n case 'cellular':\n result = 'cellular';\n break;\n case 'none':\n result = 'none';\n break;\n case 'ethernet':\n case 'wifi':\n case 'wimax':\n result = 'wifi';\n break;\n case 'other':\n case 'unknown':\n result = 'unknown';\n break;\n // possible effectiveType values\n case 'slow-2g':\n case '2g':\n case '3g':\n result = 'cellular';\n break;\n case '4g':\n result = 'wifi';\n break;\n default:\n break;\n }\n }\n return result;\n}\n\nexport class NetworkWeb extends WebPlugin implements NetworkPlugin {\n constructor() {\n super();\n if (typeof window !== 'undefined') {\n window.addEventListener('online', this.handleOnline);\n window.addEventListener('offline', this.handleOffline);\n }\n }\n\n async getStatus(): Promise<ConnectionStatus> {\n if (!window.navigator) {\n throw this.unavailable('Browser does not support the Network Information API');\n }\n\n const connected = window.navigator.onLine;\n const connectionType = translatedConnection();\n\n const status: ConnectionStatus = {\n connected,\n connectionType: connected ? connectionType : 'none',\n };\n\n return status;\n }\n\n private handleOnline = () => {\n const connectionType = translatedConnection();\n\n const status: ConnectionStatus = {\n connected: true,\n connectionType: connectionType,\n };\n\n this.notifyListeners('networkStatusChange', status);\n };\n\n private handleOffline = () => {\n const status: ConnectionStatus = {\n connected: false,\n connectionType: 'none',\n };\n\n this.notifyListeners('networkStatusChange', status);\n };\n}\n\nconst Network = new NetworkWeb();\n\nexport { Network };\n"]}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -3,13 +3,11 @@
|
|
|
3
3
|
var core = require('@capacitor/core');
|
|
4
4
|
|
|
5
5
|
const Network = core.registerPlugin('Network', {
|
|
6
|
-
web: () => Promise.resolve().then(function () { return web; }).then(m => new m.NetworkWeb()),
|
|
6
|
+
web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.NetworkWeb()),
|
|
7
7
|
});
|
|
8
8
|
|
|
9
9
|
function translatedConnection() {
|
|
10
|
-
const connection = window.navigator.connection ||
|
|
11
|
-
window.navigator.mozConnection ||
|
|
12
|
-
window.navigator.webkitConnection;
|
|
10
|
+
const connection = window.navigator.connection || window.navigator.mozConnection || window.navigator.webkitConnection;
|
|
13
11
|
let result = 'unknown';
|
|
14
12
|
const type = connection ? connection.type || connection.effectiveType : null;
|
|
15
13
|
if (type && typeof type === 'string') {
|
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Network = registerPlugin('Network', {\n web: () => import('./web').then(m => new m.NetworkWeb()),\n});\nexport * from './definitions';\nexport { Network };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nfunction translatedConnection() {\n const connection = window.navigator.connection
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Network = registerPlugin('Network', {\n web: () => import('./web').then((m) => new m.NetworkWeb()),\n});\nexport * from './definitions';\nexport { Network };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nfunction translatedConnection() {\n const connection = window.navigator.connection || window.navigator.mozConnection || window.navigator.webkitConnection;\n let result = 'unknown';\n const type = connection ? connection.type || connection.effectiveType : null;\n if (type && typeof type === 'string') {\n switch (type) {\n // possible type values\n case 'bluetooth':\n case 'cellular':\n result = 'cellular';\n break;\n case 'none':\n result = 'none';\n break;\n case 'ethernet':\n case 'wifi':\n case 'wimax':\n result = 'wifi';\n break;\n case 'other':\n case 'unknown':\n result = 'unknown';\n break;\n // possible effectiveType values\n case 'slow-2g':\n case '2g':\n case '3g':\n result = 'cellular';\n break;\n case '4g':\n result = 'wifi';\n break;\n default:\n break;\n }\n }\n return result;\n}\nexport class NetworkWeb extends WebPlugin {\n constructor() {\n super();\n this.handleOnline = () => {\n const connectionType = translatedConnection();\n const status = {\n connected: true,\n connectionType: connectionType,\n };\n this.notifyListeners('networkStatusChange', status);\n };\n this.handleOffline = () => {\n const status = {\n connected: false,\n connectionType: 'none',\n };\n this.notifyListeners('networkStatusChange', status);\n };\n if (typeof window !== 'undefined') {\n window.addEventListener('online', this.handleOnline);\n window.addEventListener('offline', this.handleOffline);\n }\n }\n async getStatus() {\n if (!window.navigator) {\n throw this.unavailable('Browser does not support the Network Information API');\n }\n const connected = window.navigator.onLine;\n const connectionType = translatedConnection();\n const status = {\n connected,\n connectionType: connected ? connectionType : 'none',\n };\n return status;\n }\n}\nconst Network = new NetworkWeb();\nexport { Network };\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AACK,MAAC,OAAO,GAAGA,mBAAc,CAAC,SAAS,EAAE;AAC1C,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;AAC9D,CAAC;;ACFD,SAAS,oBAAoB,GAAG;AAChC,IAAI,MAAM,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC,UAAU,IAAI,MAAM,CAAC,SAAS,CAAC,aAAa,IAAI,MAAM,CAAC,SAAS,CAAC,gBAAgB;AACzH,IAAI,IAAI,MAAM,GAAG,SAAS;AAC1B,IAAI,MAAM,IAAI,GAAG,UAAU,GAAG,UAAU,CAAC,IAAI,IAAI,UAAU,CAAC,aAAa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AAE,MAAM;AACtC,aAAa;AACb,YAAY,IAAI,CAAC,eAAe,CAAC,qBAAqB,EAAE,MAAM,CAAC;AAC/D,QAAQ,CAAC;AACT,QAAQ,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;AAC3C,YAAY,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,IAAI,CAAC,YAAY,CAAC;AAChE,YAAY,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC;AAClE,QAAQ;AACR,IAAI;AACJ,IAAI,MAAM,SAAS,GAAG;AACtB,QAAQ,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE;AAC/B,YAAY,MAAM,IAAI,CAAC,WAAW,CAAC,sDAAsD,CAAC;AAC1F,QAAQ;AACR,QAAQ,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC,MAAM;AACjD,QAAQ,MAAM,cAAc,GAAG,oBAAoB,EAAE;AACrD,QAAQ,MAAM,MAAM,GAAG;AACvB,YAAY,SAAS;AACrB,YAAY,cAAc,EAAE,SAAS,GAAG,cAAc,GAAG,MAAM;AAC/D,SAAS;AACT,QAAQ,OAAO,MAAM;AACrB,IAAI;AACJ;AACgB,IAAI,UAAU;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -2,13 +2,11 @@ var capacitorNetwork = (function (exports, core) {
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
const Network = core.registerPlugin('Network', {
|
|
5
|
-
web: () => Promise.resolve().then(function () { return web; }).then(m => new m.NetworkWeb()),
|
|
5
|
+
web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.NetworkWeb()),
|
|
6
6
|
});
|
|
7
7
|
|
|
8
8
|
function translatedConnection() {
|
|
9
|
-
const connection = window.navigator.connection ||
|
|
10
|
-
window.navigator.mozConnection ||
|
|
11
|
-
window.navigator.webkitConnection;
|
|
9
|
+
const connection = window.navigator.connection || window.navigator.mozConnection || window.navigator.webkitConnection;
|
|
12
10
|
let result = 'unknown';
|
|
13
11
|
const type = connection ? connection.type || connection.effectiveType : null;
|
|
14
12
|
if (type && typeof type === 'string') {
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Network = registerPlugin('Network', {\n web: () => import('./web').then(m => new m.NetworkWeb()),\n});\nexport * from './definitions';\nexport { Network };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nfunction translatedConnection() {\n const connection = window.navigator.connection
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Network = registerPlugin('Network', {\n web: () => import('./web').then((m) => new m.NetworkWeb()),\n});\nexport * from './definitions';\nexport { Network };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nfunction translatedConnection() {\n const connection = window.navigator.connection || window.navigator.mozConnection || window.navigator.webkitConnection;\n let result = 'unknown';\n const type = connection ? connection.type || connection.effectiveType : null;\n if (type && typeof type === 'string') {\n switch (type) {\n // possible type values\n case 'bluetooth':\n case 'cellular':\n result = 'cellular';\n break;\n case 'none':\n result = 'none';\n break;\n case 'ethernet':\n case 'wifi':\n case 'wimax':\n result = 'wifi';\n break;\n case 'other':\n case 'unknown':\n result = 'unknown';\n break;\n // possible effectiveType values\n case 'slow-2g':\n case '2g':\n case '3g':\n result = 'cellular';\n break;\n case '4g':\n result = 'wifi';\n break;\n default:\n break;\n }\n }\n return result;\n}\nexport class NetworkWeb extends WebPlugin {\n constructor() {\n super();\n this.handleOnline = () => {\n const connectionType = translatedConnection();\n const status = {\n connected: true,\n connectionType: connectionType,\n };\n this.notifyListeners('networkStatusChange', status);\n };\n this.handleOffline = () => {\n const status = {\n connected: false,\n connectionType: 'none',\n };\n this.notifyListeners('networkStatusChange', status);\n };\n if (typeof window !== 'undefined') {\n window.addEventListener('online', this.handleOnline);\n window.addEventListener('offline', this.handleOffline);\n }\n }\n async getStatus() {\n if (!window.navigator) {\n throw this.unavailable('Browser does not support the Network Information API');\n }\n const connected = window.navigator.onLine;\n const connectionType = translatedConnection();\n const status = {\n connected,\n connectionType: connected ? connectionType : 'none',\n };\n return status;\n }\n}\nconst Network = new NetworkWeb();\nexport { Network };\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,OAAO,GAAGA,mBAAc,CAAC,SAAS,EAAE;IAC1C,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;IAC9D,CAAC;;ICFD,SAAS,oBAAoB,GAAG;IAChC,IAAI,MAAM,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC,UAAU,IAAI,MAAM,CAAC,SAAS,CAAC,aAAa,IAAI,MAAM,CAAC,SAAS,CAAC,gBAAgB;IACzH,IAAI,IAAI,MAAM,GAAG,SAAS;IAC1B,IAAI,MAAM,IAAI,GAAG,UAAU,GAAG,UAAU,CAAC,IAAI,IAAI,UAAU,CAAC,aAAa,GAAG,IAAI;IAChF,IAAI,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;IAC1C,QAAQ,QAAQ,IAAI;IACpB;IACA,YAAY,KAAK,WAAW;IAC5B,YAAY,KAAK,UAAU;IAC3B,gBAAgB,MAAM,GAAG,UAAU;IACnC,gBAAgB;IAChB,YAAY,KAAK,MAAM;IACvB,gBAAgB,MAAM,GAAG,MAAM;IAC/B,gBAAgB;IAChB,YAAY,KAAK,UAAU;IAC3B,YAAY,KAAK,MAAM;IACvB,YAAY,KAAK,OAAO;IACxB,gBAAgB,MAAM,GAAG,MAAM;IAC/B,gBAAgB;IAChB,YAAY,KAAK,OAAO;IACxB,YAAY,KAAK,SAAS;IAC1B,gBAAgB,MAAM,GAAG,SAAS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;IACR,QAAQ,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC,MAAM;IACjD,QAAQ,MAAM,cAAc,GAAG,oBAAoB,EAAE;IACrD,QAAQ,MAAM,MAAM,GAAG;IACvB,YAAY,SAAS;IACrB,YAAY,cAAc,EAAE,SAAS,GAAG,cAAc,GAAG,MAAM;IAC/D,SAAS;IACT,QAAQ,OAAO,MAAM;IACrB,IAAI;IACJ;IACgB,IAAI,UAAU;;;;;;;;;;;;;;;"}
|
|
@@ -191,7 +191,7 @@ public extension Reachability {
|
|
|
191
191
|
_ = unmanagedWeakifiedReachability.retain()
|
|
192
192
|
return UnsafeRawPointer(unmanagedWeakifiedReachability.toOpaque())
|
|
193
193
|
},
|
|
194
|
-
release: { (info: UnsafeRawPointer)
|
|
194
|
+
release: { (info: UnsafeRawPointer) in
|
|
195
195
|
let unmanagedWeakifiedReachability = Unmanaged<ReachabilityWeakifier>.fromOpaque(info)
|
|
196
196
|
unmanagedWeakifiedReachability.release()
|
|
197
197
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capacitor/network",
|
|
3
|
-
"version": "8.0.0-dev-
|
|
3
|
+
"version": "8.0.0-dev-2444-20251112T191749.0",
|
|
4
4
|
"description": "The Network API provides network and connectivity information.",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
|
|
38
38
|
"fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format",
|
|
39
39
|
"eslint": "eslint . --ext ts",
|
|
40
|
-
"prettier": "prettier \"**/*.{css,html,ts,js,java}\"",
|
|
40
|
+
"prettier": "prettier \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java",
|
|
41
41
|
"swiftlint": "node-swiftlint",
|
|
42
42
|
"docgen": "docgen --api NetworkPlugin --output-readme README.md --output-json dist/docs.json",
|
|
43
43
|
"build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs",
|
|
@@ -52,11 +52,11 @@
|
|
|
52
52
|
"@capacitor/docgen": "0.2.2",
|
|
53
53
|
"@capacitor/ios": "next",
|
|
54
54
|
"@ionic/eslint-config": "^0.4.0",
|
|
55
|
-
"@ionic/prettier-config": "
|
|
55
|
+
"@ionic/prettier-config": "^4.0.0",
|
|
56
56
|
"@ionic/swiftlint-config": "^1.1.2",
|
|
57
57
|
"eslint": "^8.57.0",
|
|
58
|
-
"prettier": "
|
|
59
|
-
"prettier-plugin-java": "
|
|
58
|
+
"prettier": "^3.6.2",
|
|
59
|
+
"prettier-plugin-java": "^2.7.7",
|
|
60
60
|
"rimraf": "^6.0.1",
|
|
61
61
|
"rollup": "^4.26.0",
|
|
62
62
|
"swiftlint": "^1.0.1",
|