@cap-kit/test-plugin 1.0.1 → 1.0.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.
- package/{TestPlugin.podspec → CapKitTest.podspec} +1 -1
- package/Package.swift +8 -5
- package/README.md +35 -7
- package/android/src/main/java/io/capkit/test/{Test.kt → TestImpl.kt} +8 -5
- package/android/src/main/java/io/capkit/test/TestPlugin.kt +23 -19
- package/android/src/main/java/io/capkit/test/utils/{Logger.kt → TestLogger.kt} +2 -2
- package/dist/esm/definitions.d.ts +3 -3
- package/dist/esm/definitions.js +3 -3
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/web.d.ts +5 -10
- package/dist/esm/web.js +4 -2
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +8 -6
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +8 -6
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/TestPlugin/{Test.swift → TestImpl.swift} +6 -9
- package/ios/Sources/TestPlugin/TestPlugin.swift +13 -25
- package/ios/Tests/TestPluginTests/TestPluginTests.swift +7 -1
- package/package.json +4 -4
- /package/ios/Sources/TestPlugin/Utils/{Logging.swift → TestLogger.swift} +0 -0
package/Package.swift
CHANGED
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
import PackageDescription
|
|
3
3
|
|
|
4
4
|
let package = Package(
|
|
5
|
-
name: "
|
|
5
|
+
name: "CapKitTest",
|
|
6
6
|
platforms: [.iOS(.v15)],
|
|
7
7
|
products: [
|
|
8
8
|
.library(
|
|
9
|
-
name: "
|
|
10
|
-
targets: ["TestPlugin"]
|
|
9
|
+
name: "CapKitTest",
|
|
10
|
+
targets: ["TestPlugin"]
|
|
11
|
+
)
|
|
11
12
|
],
|
|
12
13
|
dependencies: [
|
|
13
14
|
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "8.0.0")
|
|
@@ -17,8 +18,10 @@ let package = Package(
|
|
|
17
18
|
name: "TestPlugin",
|
|
18
19
|
dependencies: [
|
|
19
20
|
.product(name: "Capacitor", package: "capacitor-swift-pm"),
|
|
20
|
-
.product(name: "Cordova", package: "capacitor-swift-pm")
|
|
21
|
-
|
|
21
|
+
.product(name: "Cordova", package: "capacitor-swift-pm")
|
|
22
|
+
],
|
|
23
|
+
path: "ios/Sources/TestPlugin"
|
|
24
|
+
),
|
|
22
25
|
.testTarget(
|
|
23
26
|
name: "TestPluginTests",
|
|
24
27
|
dependencies: ["TestPlugin"],
|
package/README.md
CHANGED
|
@@ -13,21 +13,31 @@
|
|
|
13
13
|
</strong>
|
|
14
14
|
</p>
|
|
15
15
|
|
|
16
|
-
<p align="center">
|
|
16
|
+
<p align="center">
|
|
17
|
+
The <strong>architectural reference implementation</strong> for the Cap-Kit ecosystem.<br>
|
|
18
|
+
This package serves as the definitive <strong>boilerplate and validation ground</strong> for creating new Capacitor plugins.<br>
|
|
19
|
+
It demonstrates the enforced monorepo structure, build configuration, and native bridges (Swift/Kotlin) required by our standards.<br>
|
|
20
|
+
<em>Note: This is an internal reference package, primarily used for CI verification and scaffolding.</em>
|
|
21
|
+
</p>
|
|
17
22
|
|
|
18
23
|
<p align="center">
|
|
19
24
|
<a href="https://www.npmjs.com/package/@cap-kit/test-plugin">
|
|
20
|
-
<img src="https://img.shields.io/npm/v/@cap-kit/test-plugin?style=flat-square"
|
|
25
|
+
<img src="https://img.shields.io/npm/v/@cap-kit/test-plugin?color=blue&label=npm&logo=npm&style=flat-square" alt="npm version">
|
|
21
26
|
</a>
|
|
22
|
-
<a href="https://
|
|
23
|
-
<img src="https://img.shields.io/
|
|
27
|
+
<a href="https://github.com/cap-kit/capacitor-plugins/actions">
|
|
28
|
+
<img src="https://img.shields.io/github/actions/workflow/status/cap-kit/capacitor-plugins/ci.yml?branch=main&label=CI&logo=github&style=flat-square" alt="CI Status" />
|
|
29
|
+
</a>
|
|
30
|
+
<a href="https://capacitorjs.com/">
|
|
31
|
+
<img src="https://img.shields.io/badge/Capacitor-Plugin-blue?logo=capacitor&style=flat-square" alt="Capacitor Plugin">
|
|
24
32
|
</a>
|
|
25
33
|
<a href="https://www.npmjs.com/package/@cap-kit/test-plugin">
|
|
26
|
-
<img src="https://img.shields.io/npm/
|
|
34
|
+
<img src="https://img.shields.io/npm/dm/@cap-kit/test-plugin?style=flat-square" alt="Downloads" />
|
|
27
35
|
</a>
|
|
28
|
-
<
|
|
36
|
+
<a href="./LICENSE">
|
|
37
|
+
<img src="https://img.shields.io/npm/l/@cap-kit/test-plugin?style=flat-square&logo=open-source-initiative&logoColor=white&color=green" alt="License" />
|
|
38
|
+
</a>
|
|
39
|
+
<img src="https://img.shields.io/maintenance/yes/2026?style=flat-square" alt="Maintained" />
|
|
29
40
|
</p>
|
|
30
|
-
|
|
31
41
|
<br>
|
|
32
42
|
|
|
33
43
|
## Install
|
|
@@ -219,3 +229,21 @@ Result object returned by the `getPluginVersion()` method.
|
|
|
219
229
|
## Contributing
|
|
220
230
|
|
|
221
231
|
Contributions are welcome! Please read the [contributing guide](CONTRIBUTING.md) before submitting a pull request.
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
## Credits
|
|
236
|
+
|
|
237
|
+
This plugin is based on prior work from the Community and
|
|
238
|
+
has been refactored and modernized for **Capacitor v8** and
|
|
239
|
+
**Swift Package Manager** compatibility.
|
|
240
|
+
|
|
241
|
+
Original inspiration:
|
|
242
|
+
|
|
243
|
+
- [https://github.com/](https://github.com/)
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
## License
|
|
248
|
+
|
|
249
|
+
MIT
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
package io.capkit.test
|
|
2
2
|
|
|
3
3
|
import android.content.Context
|
|
4
|
-
import io.capkit.test.utils.
|
|
4
|
+
import io.capkit.test.utils.TestLogger
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Platform-specific native implementation for the Test plugin.
|
|
@@ -14,7 +14,7 @@ import io.capkit.test.utils.Logger
|
|
|
14
14
|
* - handling PluginCall objects
|
|
15
15
|
* - delegating logic to this implementation
|
|
16
16
|
*/
|
|
17
|
-
class
|
|
17
|
+
class TestImpl(
|
|
18
18
|
private val context: Context,
|
|
19
19
|
) {
|
|
20
20
|
/**
|
|
@@ -32,8 +32,11 @@ class Test(
|
|
|
32
32
|
*/
|
|
33
33
|
fun updateConfig(newConfig: TestConfig) {
|
|
34
34
|
this.config = newConfig
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
TestLogger.verbose = newConfig.verboseLogging
|
|
36
|
+
TestLogger.debug(
|
|
37
|
+
"Configuration applied. Verbose logging:",
|
|
38
|
+
newConfig.verboseLogging.toString(),
|
|
39
|
+
)
|
|
37
40
|
}
|
|
38
41
|
|
|
39
42
|
/**
|
|
@@ -43,7 +46,7 @@ class Test(
|
|
|
43
46
|
* and is intentionally side-effect free.
|
|
44
47
|
*/
|
|
45
48
|
fun echo(value: String): String {
|
|
46
|
-
|
|
49
|
+
TestLogger.debug(value)
|
|
47
50
|
return value
|
|
48
51
|
}
|
|
49
52
|
|
|
@@ -3,14 +3,11 @@ package io.capkit.test
|
|
|
3
3
|
import android.content.Intent
|
|
4
4
|
import android.net.Uri
|
|
5
5
|
import android.provider.Settings
|
|
6
|
-
import androidx.activity.result.ActivityResult
|
|
7
6
|
import com.getcapacitor.JSObject
|
|
8
7
|
import com.getcapacitor.Plugin
|
|
9
8
|
import com.getcapacitor.PluginCall
|
|
10
9
|
import com.getcapacitor.PluginMethod
|
|
11
|
-
import com.getcapacitor.annotation.ActivityCallback
|
|
12
10
|
import com.getcapacitor.annotation.CapacitorPlugin
|
|
13
|
-
import io.capkit.test.utils.Logger
|
|
14
11
|
|
|
15
12
|
/**
|
|
16
13
|
* Capacitor bridge for the Test plugin.
|
|
@@ -33,7 +30,7 @@ class TestPlugin : Plugin() {
|
|
|
33
30
|
/**
|
|
34
31
|
* Native implementation containing platform logic.
|
|
35
32
|
*/
|
|
36
|
-
private lateinit var implementation:
|
|
33
|
+
private lateinit var implementation: TestImpl
|
|
37
34
|
|
|
38
35
|
/**
|
|
39
36
|
* Called once when the plugin is loaded by the Capacitor bridge.
|
|
@@ -47,11 +44,11 @@ class TestPlugin : Plugin() {
|
|
|
47
44
|
super.load()
|
|
48
45
|
|
|
49
46
|
config = TestConfig(this)
|
|
50
|
-
implementation =
|
|
47
|
+
implementation = TestImpl(context)
|
|
51
48
|
implementation.updateConfig(config)
|
|
52
49
|
}
|
|
53
50
|
|
|
54
|
-
// --- ---
|
|
51
|
+
// --- Echo ---
|
|
55
52
|
|
|
56
53
|
/**
|
|
57
54
|
* Echoes a string back to JavaScript.
|
|
@@ -61,7 +58,6 @@ class TestPlugin : Plugin() {
|
|
|
61
58
|
@PluginMethod
|
|
62
59
|
fun echo(call: PluginCall) {
|
|
63
60
|
var value = call.getString("value") ?: ""
|
|
64
|
-
Logger.debug("Echoing value: $value")
|
|
65
61
|
|
|
66
62
|
// Append the custom message from the configuration
|
|
67
63
|
value += config.customMessage
|
|
@@ -71,10 +67,10 @@ class TestPlugin : Plugin() {
|
|
|
71
67
|
call.resolve(ret)
|
|
72
68
|
}
|
|
73
69
|
|
|
74
|
-
// ---
|
|
70
|
+
// --- Version ---
|
|
75
71
|
|
|
76
72
|
/**
|
|
77
|
-
* Returns the plugin version.
|
|
73
|
+
* Returns the native plugin version.
|
|
78
74
|
*/
|
|
79
75
|
@PluginMethod
|
|
80
76
|
fun getPluginVersion(call: PluginCall) {
|
|
@@ -95,22 +91,30 @@ class TestPlugin : Plugin() {
|
|
|
95
91
|
val intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS)
|
|
96
92
|
val uri = Uri.fromParts("package", context.packageName, null)
|
|
97
93
|
intent.data = uri
|
|
98
|
-
|
|
94
|
+
context.startActivity(intent)
|
|
99
95
|
call.resolve()
|
|
100
96
|
} catch (e: Exception) {
|
|
97
|
+
// NOTE:
|
|
98
|
+
// On Android, PluginCall.reject(...) is fully supported and correctly used here.
|
|
99
|
+
// However, this plugin is designed with a cross-platform, state-based API mindset
|
|
100
|
+
// to remain compatible with iOS when using Swift Package Manager (SPM),
|
|
101
|
+
// where Promise rejection is not reliably available.
|
|
102
|
+
//
|
|
103
|
+
// For this reason:
|
|
104
|
+
// - JavaScript consumers SHOULD NOT rely on try/catch for this method
|
|
105
|
+
// - Errors should be handled by inspecting resolved result states instead
|
|
106
|
+
//
|
|
107
|
+
// This reject() call is intentionally kept on Android to:
|
|
108
|
+
// - preserve native correctness
|
|
109
|
+
// - document the platform capability
|
|
110
|
+
// - avoid hiding real failures during development
|
|
111
|
+
//
|
|
112
|
+
// When extending this plugin, consider mirroring error semantics across platforms
|
|
113
|
+
// to keep the public JS API predictable and consistent.
|
|
101
114
|
call.reject(
|
|
102
115
|
"Failed to open settings",
|
|
103
116
|
"UNAVAILABLE",
|
|
104
117
|
)
|
|
105
118
|
}
|
|
106
119
|
}
|
|
107
|
-
|
|
108
|
-
@ActivityCallback
|
|
109
|
-
private fun openSettingsResult(
|
|
110
|
-
call: PluginCall,
|
|
111
|
-
result: ActivityResult,
|
|
112
|
-
) {
|
|
113
|
-
// No-op, just to satisfy the callback requirement if needed
|
|
114
|
-
call.resolve()
|
|
115
|
-
}
|
|
116
120
|
}
|
|
@@ -5,13 +5,13 @@ import android.util.Log
|
|
|
5
5
|
/**
|
|
6
6
|
* Centralized logging utility for the Test plugin.
|
|
7
7
|
*
|
|
8
|
-
* This
|
|
8
|
+
* This logging provides a single entry point for all native logs
|
|
9
9
|
* and supports runtime-controlled verbose logging.
|
|
10
10
|
*
|
|
11
11
|
* The goal is to avoid scattering `if (verbose)` checks across
|
|
12
12
|
* business logic and keep logging behavior consistent.
|
|
13
13
|
*/
|
|
14
|
-
object
|
|
14
|
+
object TestLogger {
|
|
15
15
|
/**
|
|
16
16
|
* Logcat tag used for all plugin logs.
|
|
17
17
|
* Helps filtering logs during debugging.
|
|
@@ -70,11 +70,11 @@ export interface TestConfig {
|
|
|
70
70
|
export declare enum TestErrorCode {
|
|
71
71
|
/** The device does not have the requested hardware. */
|
|
72
72
|
UNAVAILABLE = "UNAVAILABLE",
|
|
73
|
-
/** The user denied the permission or the feature is disabled
|
|
73
|
+
/** The user denied the permission or the feature is disabled. */
|
|
74
74
|
PERMISSION_DENIED = "PERMISSION_DENIED",
|
|
75
|
-
/** The
|
|
75
|
+
/** The TestPlugin failed to initialize (e.g., runtime error or Looper failure). */
|
|
76
76
|
INIT_FAILED = "INIT_FAILED",
|
|
77
|
-
/** The requested
|
|
77
|
+
/** The requested TestPlugin type is not valid or not supported by the plugin. */
|
|
78
78
|
UNKNOWN_TYPE = "UNKNOWN_TYPE"
|
|
79
79
|
}
|
|
80
80
|
/**
|
package/dist/esm/definitions.js
CHANGED
|
@@ -15,11 +15,11 @@ export var TestErrorCode;
|
|
|
15
15
|
(function (TestErrorCode) {
|
|
16
16
|
/** The device does not have the requested hardware. */
|
|
17
17
|
TestErrorCode["UNAVAILABLE"] = "UNAVAILABLE";
|
|
18
|
-
/** The user denied the permission or the feature is disabled
|
|
18
|
+
/** The user denied the permission or the feature is disabled. */
|
|
19
19
|
TestErrorCode["PERMISSION_DENIED"] = "PERMISSION_DENIED";
|
|
20
|
-
/** The
|
|
20
|
+
/** The TestPlugin failed to initialize (e.g., runtime error or Looper failure). */
|
|
21
21
|
TestErrorCode["INIT_FAILED"] = "INIT_FAILED";
|
|
22
|
-
/** The requested
|
|
22
|
+
/** The requested TestPlugin type is not valid or not supported by the plugin. */
|
|
23
23
|
TestErrorCode["UNKNOWN_TYPE"] = "UNKNOWN_TYPE";
|
|
24
24
|
})(TestErrorCode || (TestErrorCode = {}));
|
|
25
25
|
//# sourceMappingURL=definitions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAAA,wCAAwC;AA8DxC;;;;;;;;;;;GAWG;AACH,MAAM,CAAN,IAAY,aASX;AATD,WAAY,aAAa;IACvB,uDAAuD;IACvD,4CAA2B,CAAA;IAC3B,
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAAA,wCAAwC;AA8DxC;;;;;;;;;;;GAWG;AACH,MAAM,CAAN,IAAY,aASX;AATD,WAAY,aAAa;IACvB,uDAAuD;IACvD,4CAA2B,CAAA;IAC3B,iEAAiE;IACjE,wDAAuC,CAAA;IACvC,mFAAmF;IACnF,4CAA2B,CAAA;IAC3B,iFAAiF;IACjF,8CAA6B,CAAA;AAC/B,CAAC,EATW,aAAa,KAAb,aAAa,QASxB"}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file index.ts
|
|
3
|
-
* This file exports the
|
|
3
|
+
* This file exports the Test and registers it with Capacitor.
|
|
4
4
|
* It acts as the main entry point for accessing the plugin's functionality
|
|
5
5
|
* across different platforms, including web.
|
|
6
6
|
*/
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file index.ts
|
|
3
|
-
* This file exports the
|
|
3
|
+
* This file exports the Test and registers it with Capacitor.
|
|
4
4
|
* It acts as the main entry point for accessing the plugin's functionality
|
|
5
5
|
* across different platforms, including web.
|
|
6
6
|
*/
|
package/dist/esm/web.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WebPlugin } from '@capacitor/core';
|
|
2
|
-
import type { TestPlugin } from './definitions';
|
|
2
|
+
import type { TestPlugin, EchoOptions, EchoResult, PluginVersionResult } from './definitions';
|
|
3
3
|
/**
|
|
4
4
|
* Web implementation of the Test plugin.
|
|
5
5
|
*
|
|
@@ -19,11 +19,7 @@ export declare class TestWeb extends WebPlugin implements TestPlugin {
|
|
|
19
19
|
* @param options - An object containing a `value` property to be echoed back.
|
|
20
20
|
* @returns A promise resolving to an object containing the echoed `value`.
|
|
21
21
|
*/
|
|
22
|
-
echo(options:
|
|
23
|
-
value: string;
|
|
24
|
-
}): Promise<{
|
|
25
|
-
value: string;
|
|
26
|
-
}>;
|
|
22
|
+
echo(options: EchoOptions): Promise<EchoResult>;
|
|
27
23
|
/**
|
|
28
24
|
* Opens the app settings page.
|
|
29
25
|
* On Web, this is not applicable.
|
|
@@ -34,9 +30,8 @@ export declare class TestWeb extends WebPlugin implements TestPlugin {
|
|
|
34
30
|
/**
|
|
35
31
|
* Returns the plugin version.
|
|
36
32
|
*
|
|
37
|
-
*
|
|
33
|
+
* On the Web, this value represents the JavaScript package version
|
|
34
|
+
* rather than a native implementation.
|
|
38
35
|
*/
|
|
39
|
-
getPluginVersion(): Promise<
|
|
40
|
-
version: string;
|
|
41
|
-
}>;
|
|
36
|
+
getPluginVersion(): Promise<PluginVersionResult>;
|
|
42
37
|
}
|
package/dist/esm/web.js
CHANGED
|
@@ -37,16 +37,18 @@ export class TestWeb extends WebPlugin {
|
|
|
37
37
|
*/
|
|
38
38
|
async openAppSettings() {
|
|
39
39
|
console.warn('Test: openAppSettings is not available on Web.');
|
|
40
|
+
// Rule: Unsupported methods MUST call this.unimplemented()
|
|
40
41
|
return this.unimplemented('Not implemented on Web.');
|
|
41
42
|
}
|
|
42
43
|
// --- Plugin Info ---
|
|
43
44
|
/**
|
|
44
45
|
* Returns the plugin version.
|
|
45
46
|
*
|
|
46
|
-
*
|
|
47
|
+
* On the Web, this value represents the JavaScript package version
|
|
48
|
+
* rather than a native implementation.
|
|
47
49
|
*/
|
|
48
50
|
async getPluginVersion() {
|
|
49
|
-
return { version: 'web
|
|
51
|
+
return { version: 'web' };
|
|
50
52
|
}
|
|
51
53
|
}
|
|
52
54
|
//# sourceMappingURL=web.js.map
|
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;AAI5C;;;;;;;;GAQG;AACH,MAAM,OAAO,OAAQ,SAAQ,SAAS;IACpC;QACE,KAAK,EAAE,CAAC;IACV,CAAC;IAED,sBAAsB;IAEtB;;;;;;;OAOG;IACH,KAAK,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C;;;;;;;;GAQG;AACH,MAAM,OAAO,OAAQ,SAAQ,SAAS;IACpC;QACE,KAAK,EAAE,CAAC;IACV,CAAC;IAED,sBAAsB;IAEtB;;;;;;;OAOG;IACH,KAAK,CAAC,IAAI,CAAC,OAAoB;QAC7B,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC7B,kFAAkF;QAClF,iFAAiF;QACjF,uDAAuD;QACvD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,uBAAuB;IAEvB;;;;;OAKG;IACH,KAAK,CAAC,eAAe;QACnB,OAAO,CAAC,IAAI,CAAC,gDAAgD,CAAC,CAAC;QAC/D,2DAA2D;QAC3D,OAAO,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAU,CAAC;IAChE,CAAC;IAED,sBAAsB;IAEtB;;;;;OAKG;IACH,KAAK,CAAC,gBAAgB;QACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC5B,CAAC;CACF"}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -19,17 +19,17 @@ exports.TestErrorCode = void 0;
|
|
|
19
19
|
(function (TestErrorCode) {
|
|
20
20
|
/** The device does not have the requested hardware. */
|
|
21
21
|
TestErrorCode["UNAVAILABLE"] = "UNAVAILABLE";
|
|
22
|
-
/** The user denied the permission or the feature is disabled
|
|
22
|
+
/** The user denied the permission or the feature is disabled. */
|
|
23
23
|
TestErrorCode["PERMISSION_DENIED"] = "PERMISSION_DENIED";
|
|
24
|
-
/** The
|
|
24
|
+
/** The TestPlugin failed to initialize (e.g., runtime error or Looper failure). */
|
|
25
25
|
TestErrorCode["INIT_FAILED"] = "INIT_FAILED";
|
|
26
|
-
/** The requested
|
|
26
|
+
/** The requested TestPlugin type is not valid or not supported by the plugin. */
|
|
27
27
|
TestErrorCode["UNKNOWN_TYPE"] = "UNKNOWN_TYPE";
|
|
28
28
|
})(exports.TestErrorCode || (exports.TestErrorCode = {}));
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
* @file index.ts
|
|
32
|
-
* This file exports the
|
|
32
|
+
* This file exports the Test and registers it with Capacitor.
|
|
33
33
|
* It acts as the main entry point for accessing the plugin's functionality
|
|
34
34
|
* across different platforms, including web.
|
|
35
35
|
*/
|
|
@@ -81,16 +81,18 @@ class TestWeb extends core.WebPlugin {
|
|
|
81
81
|
*/
|
|
82
82
|
async openAppSettings() {
|
|
83
83
|
console.warn('Test: openAppSettings is not available on Web.');
|
|
84
|
+
// Rule: Unsupported methods MUST call this.unimplemented()
|
|
84
85
|
return this.unimplemented('Not implemented on Web.');
|
|
85
86
|
}
|
|
86
87
|
// --- Plugin Info ---
|
|
87
88
|
/**
|
|
88
89
|
* Returns the plugin version.
|
|
89
90
|
*
|
|
90
|
-
*
|
|
91
|
+
* On the Web, this value represents the JavaScript package version
|
|
92
|
+
* rather than a native implementation.
|
|
91
93
|
*/
|
|
92
94
|
async getPluginVersion() {
|
|
93
|
-
return { version: 'web
|
|
95
|
+
return { version: 'web' };
|
|
94
96
|
}
|
|
95
97
|
}
|
|
96
98
|
|
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/// <reference types=\"@capacitor/cli\" />\n/**\n * Standardized error codes used by the Test plugin.\n *\n * These codes are returned as part of structured error objects\n * and allow consumers to implement programmatic error handling.\n *\n * Note:\n * On iOS (Swift Package Manager), errors are returned as data\n * objects rather than rejected Promises.\n *\n * @since 1.0.0\n */\nexport var TestErrorCode;\n(function (TestErrorCode) {\n /** The device does not have the requested hardware. */\n TestErrorCode[\"UNAVAILABLE\"] = \"UNAVAILABLE\";\n /** The user denied the permission or the feature is disabled
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/// <reference types=\"@capacitor/cli\" />\n/**\n * Standardized error codes used by the Test plugin.\n *\n * These codes are returned as part of structured error objects\n * and allow consumers to implement programmatic error handling.\n *\n * Note:\n * On iOS (Swift Package Manager), errors are returned as data\n * objects rather than rejected Promises.\n *\n * @since 1.0.0\n */\nexport var TestErrorCode;\n(function (TestErrorCode) {\n /** The device does not have the requested hardware. */\n TestErrorCode[\"UNAVAILABLE\"] = \"UNAVAILABLE\";\n /** The user denied the permission or the feature is disabled. */\n TestErrorCode[\"PERMISSION_DENIED\"] = \"PERMISSION_DENIED\";\n /** The TestPlugin failed to initialize (e.g., runtime error or Looper failure). */\n TestErrorCode[\"INIT_FAILED\"] = \"INIT_FAILED\";\n /** The requested TestPlugin type is not valid or not supported by the plugin. */\n TestErrorCode[\"UNKNOWN_TYPE\"] = \"UNKNOWN_TYPE\";\n})(TestErrorCode || (TestErrorCode = {}));\n//# sourceMappingURL=definitions.js.map","/**\n * @file index.ts\n * This file exports the Test and registers it with Capacitor.\n * It acts as the main entry point for accessing the plugin's functionality\n * across different platforms, including web.\n */\nimport { registerPlugin } from '@capacitor/core';\n/**\n * Main entry point for the Test Capacitor plugin.\n *\n * This file registers the plugin with Capacitor and exports\n * both the runtime instance and the public TypeScript types.\n */\nconst Test = registerPlugin('Test', {\n web: () => import('./web').then((m) => new m.TestWeb()),\n});\nexport * from './definitions';\nexport { Test };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\n/**\n * Web implementation of the Test plugin.\n *\n * This implementation exists primarily to satisfy Capacitor's\n * multi-platform contract and to allow usage in browser-based\n * environments.\n *\n * Native-only features may be unavailable on Web.\n */\nexport class TestWeb extends WebPlugin {\n constructor() {\n super();\n }\n // --- Echo Method ---\n /**\n * Echoes a value back for the web platform.\n * This method is a basic implementation example, primarily for testing\n * or validating communication with the plugin.\n *\n * @param options - An object containing a `value` property to be echoed back.\n * @returns A promise resolving to an object containing the echoed `value`.\n */\n async echo(options) {\n console.log('ECHO', options);\n // Note: On the web, reading 'capacitor.config.ts' requires specific build setups.\n // We pass the value through as-is for parity, or you can implement logic to read\n // from a global config object if your app exposes one.\n return options;\n }\n // --- App Settings ---\n /**\n * Opens the app settings page.\n * On Web, this is not applicable.\n *\n * @returns A promise that resolves when the operation is complete.\n */\n async openAppSettings() {\n console.warn('Test: openAppSettings is not available on Web.');\n // Rule: Unsupported methods MUST call this.unimplemented()\n return this.unimplemented('Not implemented on Web.');\n }\n // --- Plugin Info ---\n /**\n * Returns the plugin version.\n *\n * On the Web, this value represents the JavaScript package version\n * rather than a native implementation.\n */\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["TestErrorCode","registerPlugin","WebPlugin"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACWA;AACX,CAAC,UAAU,aAAa,EAAE;AAC1B;AACA,IAAI,aAAa,CAAC,aAAa,CAAC,GAAG,aAAa;AAChD;AACA,IAAI,aAAa,CAAC,mBAAmB,CAAC,GAAG,mBAAmB;AAC5D;AACA,IAAI,aAAa,CAAC,aAAa,CAAC,GAAG,aAAa;AAChD;AACA,IAAI,aAAa,CAAC,cAAc,CAAC,GAAG,cAAc;AAClD,CAAC,EAAEA,qBAAa,KAAKA,qBAAa,GAAG,EAAE,CAAC,CAAC;;ACvBzC;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACK,MAAC,IAAI,GAAGC,mBAAc,CAAC,MAAM,EAAE;AACpC,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;AAC3D,CAAC;;ACdD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,OAAO,SAASC,cAAS,CAAC;AACvC,IAAI,WAAW,GAAG;AAClB,QAAQ,KAAK,EAAE;AACf,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;AACxB,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;AACpC;AACA;AACA;AACA,QAAQ,OAAO,OAAO;AACtB,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,MAAM,eAAe,GAAG;AAC5B,QAAQ,OAAO,CAAC,IAAI,CAAC,gDAAgD,CAAC;AACtE;AACA,QAAQ,OAAO,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC5D,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;AACjC,IAAI;AACJ;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -18,17 +18,17 @@ var capacitorTest = (function (exports, core) {
|
|
|
18
18
|
(function (TestErrorCode) {
|
|
19
19
|
/** The device does not have the requested hardware. */
|
|
20
20
|
TestErrorCode["UNAVAILABLE"] = "UNAVAILABLE";
|
|
21
|
-
/** The user denied the permission or the feature is disabled
|
|
21
|
+
/** The user denied the permission or the feature is disabled. */
|
|
22
22
|
TestErrorCode["PERMISSION_DENIED"] = "PERMISSION_DENIED";
|
|
23
|
-
/** The
|
|
23
|
+
/** The TestPlugin failed to initialize (e.g., runtime error or Looper failure). */
|
|
24
24
|
TestErrorCode["INIT_FAILED"] = "INIT_FAILED";
|
|
25
|
-
/** The requested
|
|
25
|
+
/** The requested TestPlugin type is not valid or not supported by the plugin. */
|
|
26
26
|
TestErrorCode["UNKNOWN_TYPE"] = "UNKNOWN_TYPE";
|
|
27
27
|
})(exports.TestErrorCode || (exports.TestErrorCode = {}));
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
30
|
* @file index.ts
|
|
31
|
-
* This file exports the
|
|
31
|
+
* This file exports the Test and registers it with Capacitor.
|
|
32
32
|
* It acts as the main entry point for accessing the plugin's functionality
|
|
33
33
|
* across different platforms, including web.
|
|
34
34
|
*/
|
|
@@ -80,16 +80,18 @@ var capacitorTest = (function (exports, core) {
|
|
|
80
80
|
*/
|
|
81
81
|
async openAppSettings() {
|
|
82
82
|
console.warn('Test: openAppSettings is not available on Web.');
|
|
83
|
+
// Rule: Unsupported methods MUST call this.unimplemented()
|
|
83
84
|
return this.unimplemented('Not implemented on Web.');
|
|
84
85
|
}
|
|
85
86
|
// --- Plugin Info ---
|
|
86
87
|
/**
|
|
87
88
|
* Returns the plugin version.
|
|
88
89
|
*
|
|
89
|
-
*
|
|
90
|
+
* On the Web, this value represents the JavaScript package version
|
|
91
|
+
* rather than a native implementation.
|
|
90
92
|
*/
|
|
91
93
|
async getPluginVersion() {
|
|
92
|
-
return { version: 'web
|
|
94
|
+
return { version: 'web' };
|
|
93
95
|
}
|
|
94
96
|
}
|
|
95
97
|
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/// <reference types=\"@capacitor/cli\" />\n/**\n * Standardized error codes used by the Test plugin.\n *\n * These codes are returned as part of structured error objects\n * and allow consumers to implement programmatic error handling.\n *\n * Note:\n * On iOS (Swift Package Manager), errors are returned as data\n * objects rather than rejected Promises.\n *\n * @since 1.0.0\n */\nexport var TestErrorCode;\n(function (TestErrorCode) {\n /** The device does not have the requested hardware. */\n TestErrorCode[\"UNAVAILABLE\"] = \"UNAVAILABLE\";\n /** The user denied the permission or the feature is disabled
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/// <reference types=\"@capacitor/cli\" />\n/**\n * Standardized error codes used by the Test plugin.\n *\n * These codes are returned as part of structured error objects\n * and allow consumers to implement programmatic error handling.\n *\n * Note:\n * On iOS (Swift Package Manager), errors are returned as data\n * objects rather than rejected Promises.\n *\n * @since 1.0.0\n */\nexport var TestErrorCode;\n(function (TestErrorCode) {\n /** The device does not have the requested hardware. */\n TestErrorCode[\"UNAVAILABLE\"] = \"UNAVAILABLE\";\n /** The user denied the permission or the feature is disabled. */\n TestErrorCode[\"PERMISSION_DENIED\"] = \"PERMISSION_DENIED\";\n /** The TestPlugin failed to initialize (e.g., runtime error or Looper failure). */\n TestErrorCode[\"INIT_FAILED\"] = \"INIT_FAILED\";\n /** The requested TestPlugin type is not valid or not supported by the plugin. */\n TestErrorCode[\"UNKNOWN_TYPE\"] = \"UNKNOWN_TYPE\";\n})(TestErrorCode || (TestErrorCode = {}));\n//# sourceMappingURL=definitions.js.map","/**\n * @file index.ts\n * This file exports the Test and registers it with Capacitor.\n * It acts as the main entry point for accessing the plugin's functionality\n * across different platforms, including web.\n */\nimport { registerPlugin } from '@capacitor/core';\n/**\n * Main entry point for the Test Capacitor plugin.\n *\n * This file registers the plugin with Capacitor and exports\n * both the runtime instance and the public TypeScript types.\n */\nconst Test = registerPlugin('Test', {\n web: () => import('./web').then((m) => new m.TestWeb()),\n});\nexport * from './definitions';\nexport { Test };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\n/**\n * Web implementation of the Test plugin.\n *\n * This implementation exists primarily to satisfy Capacitor's\n * multi-platform contract and to allow usage in browser-based\n * environments.\n *\n * Native-only features may be unavailable on Web.\n */\nexport class TestWeb extends WebPlugin {\n constructor() {\n super();\n }\n // --- Echo Method ---\n /**\n * Echoes a value back for the web platform.\n * This method is a basic implementation example, primarily for testing\n * or validating communication with the plugin.\n *\n * @param options - An object containing a `value` property to be echoed back.\n * @returns A promise resolving to an object containing the echoed `value`.\n */\n async echo(options) {\n console.log('ECHO', options);\n // Note: On the web, reading 'capacitor.config.ts' requires specific build setups.\n // We pass the value through as-is for parity, or you can implement logic to read\n // from a global config object if your app exposes one.\n return options;\n }\n // --- App Settings ---\n /**\n * Opens the app settings page.\n * On Web, this is not applicable.\n *\n * @returns A promise that resolves when the operation is complete.\n */\n async openAppSettings() {\n console.warn('Test: openAppSettings is not available on Web.');\n // Rule: Unsupported methods MUST call this.unimplemented()\n return this.unimplemented('Not implemented on Web.');\n }\n // --- Plugin Info ---\n /**\n * Returns the plugin version.\n *\n * On the Web, this value represents the JavaScript package version\n * rather than a native implementation.\n */\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["TestErrorCode","registerPlugin","WebPlugin"],"mappings":";;;IAAA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;AACWA;IACX,CAAC,UAAU,aAAa,EAAE;IAC1B;IACA,IAAI,aAAa,CAAC,aAAa,CAAC,GAAG,aAAa;IAChD;IACA,IAAI,aAAa,CAAC,mBAAmB,CAAC,GAAG,mBAAmB;IAC5D;IACA,IAAI,aAAa,CAAC,aAAa,CAAC,GAAG,aAAa;IAChD;IACA,IAAI,aAAa,CAAC,cAAc,CAAC,GAAG,cAAc;IAClD,CAAC,EAAEA,qBAAa,KAAKA,qBAAa,GAAG,EAAE,CAAC,CAAC;;ICvBzC;IACA;IACA;IACA;IACA;IACA;IAEA;IACA;IACA;IACA;IACA;IACA;AACK,UAAC,IAAI,GAAGC,mBAAc,CAAC,MAAM,EAAE;IACpC,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;IAC3D,CAAC;;ICdD;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACO,MAAM,OAAO,SAASC,cAAS,CAAC;IACvC,IAAI,WAAW,GAAG;IAClB,QAAQ,KAAK,EAAE;IACf,IAAI;IACJ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;IACxB,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IACpC;IACA;IACA;IACA,QAAQ,OAAO,OAAO;IACtB,IAAI;IACJ;IACA;IACA;IACA;IACA;IACA;IACA;IACA,IAAI,MAAM,eAAe,GAAG;IAC5B,QAAQ,OAAO,CAAC,IAAI,CAAC,gDAAgD,CAAC;IACtE;IACA,QAAQ,OAAO,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC5D,IAAI;IACJ;IACA;IACA;IACA;IACA;IACA;IACA;IACA,IAAI,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;IACjC,IAAI;IACJ;;;;;;;;;;;;;;;"}
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import Foundation
|
|
2
|
-
import Capacitor
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
|
-
Native implementation for the Test
|
|
4
|
+
Native iOS implementation for the Test plugin.
|
|
6
5
|
|
|
7
|
-
This class contains platform
|
|
6
|
+
This class contains ONLY platform logic and must not:
|
|
8
7
|
- access CAPPluginCall
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
|
|
12
|
-
The Capacitor plugin class is responsible for delegating work to this class.
|
|
8
|
+
- depend on Capacitor
|
|
9
|
+
- perform mapping logic
|
|
13
10
|
*/
|
|
14
|
-
@objc public class
|
|
11
|
+
@objc public final class TestImpl: NSObject {
|
|
15
12
|
|
|
16
13
|
// Properties
|
|
17
14
|
private var config: TestConfig?
|
|
@@ -33,7 +30,7 @@ import Capacitor
|
|
|
33
30
|
func applyConfig(_ config: TestConfig) {
|
|
34
31
|
self.config = config
|
|
35
32
|
TestLogger.verbose = config.verboseLogging
|
|
36
|
-
TestLogger.debug("Configuration applied. Verbose logging
|
|
33
|
+
TestLogger.debug("Configuration applied. Verbose logging:", "\(config.verboseLogging)")
|
|
37
34
|
}
|
|
38
35
|
|
|
39
36
|
// MARK: - Echo Method
|
|
@@ -4,20 +4,19 @@ import Capacitor
|
|
|
4
4
|
/**
|
|
5
5
|
Capacitor bridge for the Test plugin.
|
|
6
6
|
|
|
7
|
-
This
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
- delegating logic to the native implementation
|
|
7
|
+
This file MUST:
|
|
8
|
+
- read input from CAPPluginCall
|
|
9
|
+
- delegate logic to TestImpl
|
|
10
|
+
- resolve calls using state-based results
|
|
12
11
|
*/
|
|
13
12
|
@objc(TestPlugin)
|
|
14
|
-
public class TestPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
13
|
+
public final class TestPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
15
14
|
|
|
16
15
|
// Configuration instance
|
|
17
16
|
private var config: TestConfig?
|
|
18
17
|
|
|
19
18
|
/// An instance of the implementation class that contains the plugin's core functionality.
|
|
20
|
-
private let implementation =
|
|
19
|
+
private let implementation = TestImpl()
|
|
21
20
|
|
|
22
21
|
/// The unique identifier for the plugin.
|
|
23
22
|
public let identifier = "TestPlugin"
|
|
@@ -94,32 +93,21 @@ public class TestPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
94
93
|
@objc func openAppSettings(_ call: CAPPluginCall) {
|
|
95
94
|
DispatchQueue.main.async(execute: DispatchWorkItem {
|
|
96
95
|
guard let settingsUrl = URL(string: UIApplication.openSettingsURLString) else {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
"error": "Cannot open settings URL",
|
|
100
|
-
"code": "UNAVAILABLE"
|
|
101
|
-
])
|
|
96
|
+
TestLogger.error("Cannot create settings URL")
|
|
97
|
+
call.resolve()
|
|
102
98
|
return
|
|
103
99
|
}
|
|
104
100
|
|
|
105
101
|
if UIApplication.shared.canOpenURL(settingsUrl) {
|
|
106
102
|
UIApplication.shared.open(settingsUrl, options: [:]) { success in
|
|
107
|
-
if success {
|
|
108
|
-
|
|
109
|
-
} else {
|
|
110
|
-
call.resolve([
|
|
111
|
-
"success": false,
|
|
112
|
-
"error": "Failed to open settings",
|
|
113
|
-
"code": "UNAVAILABLE"
|
|
114
|
-
])
|
|
103
|
+
if !success {
|
|
104
|
+
TestLogger.error("Failed to open app settings")
|
|
115
105
|
}
|
|
106
|
+
call.resolve()
|
|
116
107
|
}
|
|
117
108
|
} else {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
"error": "Cannot open settings URL",
|
|
121
|
-
"code": "UNAVAILABLE"
|
|
122
|
-
])
|
|
109
|
+
TestLogger.error("Cannot open settings URL")
|
|
110
|
+
call.resolve()
|
|
123
111
|
}
|
|
124
112
|
})
|
|
125
113
|
}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import XCTest
|
|
2
2
|
@testable import TestPlugin
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
Basic functional tests for the Test plugin native implementation.
|
|
6
|
+
|
|
7
|
+
These tests validate the core behavior of the implementation
|
|
8
|
+
independently from the Capacitor bridge.
|
|
9
|
+
*/
|
|
4
10
|
class TestTests: XCTestCase {
|
|
5
11
|
func testEcho() {
|
|
6
12
|
// This is an example of a functional test case for a plugin.
|
|
7
13
|
// Use XCTAssert and related functions to verify your tests produce the correct results.
|
|
8
14
|
|
|
9
|
-
let implementation =
|
|
15
|
+
let implementation = TestImpl()
|
|
10
16
|
let value = "Hello, World!"
|
|
11
17
|
let result = implementation.echo(value)
|
|
12
18
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cap-kit/test-plugin",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.0.3",
|
|
4
|
+
"description": "Architectural reference and boilerplate for Cap-Kit plugins.",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
7
7
|
"types": "dist/esm/index.d.ts",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"ios/Sources",
|
|
14
14
|
"ios/Tests",
|
|
15
15
|
"Package.swift",
|
|
16
|
-
"
|
|
16
|
+
"CapKitTest.podspec",
|
|
17
17
|
"LICENSE"
|
|
18
18
|
],
|
|
19
19
|
"author": "Fabio Martino",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
},
|
|
69
69
|
"scripts": {
|
|
70
70
|
"verify": "pnpm run verify:ios && pnpm run verify:android && pnpm run verify:web",
|
|
71
|
-
"verify:ios": "xcodebuild -scheme
|
|
71
|
+
"verify:ios": "xcodebuild -scheme CapKitTest -destination generic/platform=iOS",
|
|
72
72
|
"verify:android": "cd android && ./gradlew clean build test && cd ..",
|
|
73
73
|
"verify:web": "pnpm run build",
|
|
74
74
|
"lint:android": "cd android && ./gradlew ktlintCheck",
|
|
File without changes
|