@cap-kit/settings 8.0.0-next.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/CapKitSettings.podspec +17 -0
- package/LICENSE +21 -0
- package/Package.swift +29 -0
- package/README.md +428 -0
- package/android/build.gradle +103 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/io/capkit/settings/SettingsConfig.kt +39 -0
- package/android/src/main/java/io/capkit/settings/SettingsImpl.kt +95 -0
- package/android/src/main/java/io/capkit/settings/SettingsPlugin.kt +91 -0
- package/android/src/main/java/io/capkit/settings/utils/SettingsLogger.kt +85 -0
- package/android/src/main/java/io/capkit/settings/utils/SettingsUtils.kt +75 -0
- package/android/src/main/res/.gitkeep +0 -0
- package/dist/docs.json +877 -0
- package/dist/esm/definitions.d.ts +686 -0
- package/dist/esm/definitions.js +423 -0
- package/dist/esm/definitions.js.map +1 -0
- package/dist/esm/index.d.ts +16 -0
- package/dist/esm/index.js +19 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/web.d.ts +43 -0
- package/dist/esm/web.js +68 -0
- package/dist/esm/web.js.map +1 -0
- package/dist/plugin.cjs.js +516 -0
- package/dist/plugin.cjs.js.map +1 -0
- package/dist/plugin.js +519 -0
- package/dist/plugin.js.map +1 -0
- package/ios/Sources/SettingsPlugin/SettingsConfig.swift +54 -0
- package/ios/Sources/SettingsPlugin/SettingsImpl.swift +84 -0
- package/ios/Sources/SettingsPlugin/SettingsPlugin.swift +103 -0
- package/ios/Sources/SettingsPlugin/Utils/SettingsLogger.swift +57 -0
- package/ios/Sources/SettingsPlugin/Utils/SettingsUtils.swift +70 -0
- package/ios/Sources/SettingsPlugin/Version.swift +16 -0
- package/ios/Tests/SettingsPluginTests/SettingsPluginTests.swift +21 -0
- package/package.json +98 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
import UIKit
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
Native iOS implementation for the Settings plugin.
|
|
6
|
+
|
|
7
|
+
This class contains ONLY platform logic and must not:
|
|
8
|
+
- access CAPPluginCall
|
|
9
|
+
- depend on Capacitor
|
|
10
|
+
- contain JavaScript or bridge-related logic
|
|
11
|
+
|
|
12
|
+
Mapping from JavaScript-facing options to platform-specific
|
|
13
|
+
settings URLs is delegated to SettingsUtils.
|
|
14
|
+
*/
|
|
15
|
+
@objc public final class SettingsImpl: NSObject {
|
|
16
|
+
|
|
17
|
+
// Properties
|
|
18
|
+
private var config: SettingsConfig?
|
|
19
|
+
|
|
20
|
+
// Initializer
|
|
21
|
+
override init() {
|
|
22
|
+
super.init()
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// MARK: - Result
|
|
26
|
+
|
|
27
|
+
struct Result {
|
|
28
|
+
let success: Bool
|
|
29
|
+
let error: String?
|
|
30
|
+
let code: String?
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// MARK: - Configuration
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
Applies the plugin configuration.
|
|
37
|
+
|
|
38
|
+
This method should be called exactly once during plugin initialization.
|
|
39
|
+
Its responsibility is to translate configuration values into runtime
|
|
40
|
+
behavior (e.g. enabling verbose logging).
|
|
41
|
+
*/
|
|
42
|
+
func applyConfig(_ config: SettingsConfig) {
|
|
43
|
+
self.config = config
|
|
44
|
+
SettingsLogger.verbose = config.verboseLogging
|
|
45
|
+
SettingsLogger.debug("Configuration applied. Verbose logging:", "\(config.verboseLogging)")
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// MARK: - Settings
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
Opens the requested iOS settings page.
|
|
52
|
+
|
|
53
|
+
- Parameter option: The settings option to open.
|
|
54
|
+
|
|
55
|
+
- Returns:
|
|
56
|
+
- success: Indicates whether the URL was valid and dispatched.
|
|
57
|
+
- error: Optional human-readable error.
|
|
58
|
+
- code: Optional machine-readable error code.
|
|
59
|
+
*/
|
|
60
|
+
func open(option: String?) -> Result {
|
|
61
|
+
guard let url = SettingsUtils.resolveSettingsURL(for: option) else {
|
|
62
|
+
return Result(
|
|
63
|
+
success: false,
|
|
64
|
+
error: "Requested setting is not available on iOS",
|
|
65
|
+
code: "UNAVAILABLE"
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
guard UIApplication.shared.canOpenURL(url) else {
|
|
70
|
+
SettingsLogger.debug("Cannot open URL:", url.absoluteString)
|
|
71
|
+
return Result(
|
|
72
|
+
success: false,
|
|
73
|
+
error: "Cannot open settings URL",
|
|
74
|
+
code: "UNAVAILABLE"
|
|
75
|
+
)
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
DispatchQueue.main.async(execute: DispatchWorkItem {
|
|
79
|
+
UIApplication.shared.open(url, options: [:])
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
return Result(success: true, error: nil, code: nil)
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
import Capacitor
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
Capacitor bridge for the Settings plugin.
|
|
6
|
+
|
|
7
|
+
This file MUST:
|
|
8
|
+
- read input from CAPPluginCall
|
|
9
|
+
- delegate logic to SettingsImpl
|
|
10
|
+
- resolve calls using state-based results
|
|
11
|
+
*/
|
|
12
|
+
@objc(SettingsPlugin)
|
|
13
|
+
public final class SettingsPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
14
|
+
|
|
15
|
+
// Configuration instance
|
|
16
|
+
private var config: SettingsConfig?
|
|
17
|
+
|
|
18
|
+
/// An instance of the implementation class that contains the plugin's core functionality.
|
|
19
|
+
private let implementation = SettingsImpl()
|
|
20
|
+
|
|
21
|
+
/// The unique identifier for the plugin.
|
|
22
|
+
public let identifier = "SettingsPlugin"
|
|
23
|
+
|
|
24
|
+
/// The name used to reference this plugin in JavaScript.
|
|
25
|
+
public let jsName = "Settings"
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
A list of methods exposed by this plugin. These methods can be called from the JavaScript side.
|
|
29
|
+
- `open`: A method that opens a specified iOS settings page.
|
|
30
|
+
- `openIOS`: An alias for the `open` method, specifically for iOS
|
|
31
|
+
- `getPluginVersion`: A method that returns the version of the plugin.
|
|
32
|
+
*/
|
|
33
|
+
public let pluginMethods: [CAPPluginMethod] = [
|
|
34
|
+
CAPPluginMethod(name: "open", returnType: CAPPluginReturnPromise),
|
|
35
|
+
CAPPluginMethod(name: "openIOS", returnType: CAPPluginReturnPromise),
|
|
36
|
+
CAPPluginMethod(name: "getPluginVersion", returnType: CAPPluginReturnPromise)
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
Plugin lifecycle entry point.
|
|
41
|
+
|
|
42
|
+
Called once when the plugin is loaded by the Capacitor bridge.
|
|
43
|
+
This is the correct place to:
|
|
44
|
+
- read configuration values
|
|
45
|
+
- initialize native resources
|
|
46
|
+
- configure the implementation instance
|
|
47
|
+
*/
|
|
48
|
+
override public func load() {
|
|
49
|
+
// Initialize SettingsConfig with the correct type
|
|
50
|
+
let cfg = SettingsConfig(plugin: self)
|
|
51
|
+
self.config = cfg
|
|
52
|
+
implementation.applyConfig(cfg)
|
|
53
|
+
|
|
54
|
+
// Log if verbose logging is enabled
|
|
55
|
+
SettingsLogger.debug("Settings plugin loaded with config:", cfg)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// MARK: - Settings
|
|
59
|
+
|
|
60
|
+
/// Opens the requested iOS settings page.
|
|
61
|
+
@objc func open(_ call: CAPPluginCall) {
|
|
62
|
+
resolveOpenResult(call, option: call.getString("optionIOS", ""))
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/// Opens the requested iOS settings page.
|
|
66
|
+
@objc func openIOS(_ call: CAPPluginCall) {
|
|
67
|
+
resolveOpenResult(call, option: call.getString("option", ""))
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// MARK: - Version
|
|
71
|
+
|
|
72
|
+
/// Retrieves the plugin version synchronized from package.json.
|
|
73
|
+
@objc func getPluginVersion(_ call: CAPPluginCall) {
|
|
74
|
+
// Standardized enum name across all CapKit plugins
|
|
75
|
+
call.resolve([
|
|
76
|
+
"version": PluginVersion.number
|
|
77
|
+
])
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// MARK: - Helpers
|
|
81
|
+
|
|
82
|
+
/// Resolves the result of an open settings call.
|
|
83
|
+
private func resolveOpenResult(
|
|
84
|
+
_ call: CAPPluginCall,
|
|
85
|
+
option: String
|
|
86
|
+
) {
|
|
87
|
+
let result = implementation.open(option: option)
|
|
88
|
+
|
|
89
|
+
var payload: [String: Any] = [
|
|
90
|
+
"success": result.success
|
|
91
|
+
]
|
|
92
|
+
|
|
93
|
+
if let error = result.error {
|
|
94
|
+
payload["error"] = error
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if let code = result.code {
|
|
98
|
+
payload["code"] = code
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
call.resolve(payload)
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import Capacitor
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
Centralized logger for the Settings plugin.
|
|
5
|
+
|
|
6
|
+
This logger mirrors the Android Logger pattern and provides:
|
|
7
|
+
- a single logging entry point
|
|
8
|
+
- runtime-controlled verbose logging
|
|
9
|
+
- consistent log formatting
|
|
10
|
+
|
|
11
|
+
Business logic MUST NOT perform configuration checks directly.
|
|
12
|
+
*/
|
|
13
|
+
enum SettingsLogger {
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
Controls whether debug logs are printed.
|
|
17
|
+
|
|
18
|
+
This value is set once during plugin load
|
|
19
|
+
based on configuration values.
|
|
20
|
+
*/
|
|
21
|
+
static var verbose: Bool = false
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
Prints a verbose / debug log message.
|
|
25
|
+
|
|
26
|
+
This method is intended for development-time diagnostics
|
|
27
|
+
and is automatically silenced when verbose logging is disabled.
|
|
28
|
+
*/
|
|
29
|
+
static func debug(_ items: Any...) {
|
|
30
|
+
guard verbose else { return }
|
|
31
|
+
log(items)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
Prints an error log message.
|
|
36
|
+
|
|
37
|
+
Error logs are always printed regardless of verbosity.
|
|
38
|
+
*/
|
|
39
|
+
static func error(_ items: Any...) {
|
|
40
|
+
log(items)
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
Low-level log printer with a consistent prefix.
|
|
46
|
+
|
|
47
|
+
This function should not be used directly outside this file.
|
|
48
|
+
*/
|
|
49
|
+
private func log(_ items: Any..., separator: String = " ", terminator: String = "\n") {
|
|
50
|
+
CAPLog.print("⚡️ Settings -", terminator: separator)
|
|
51
|
+
for (itemIndex, item) in items.enumerated() {
|
|
52
|
+
CAPLog.print(
|
|
53
|
+
item,
|
|
54
|
+
terminator: itemIndex == items.count - 1 ? terminator : separator
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
import UIKit
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
Utility helpers for resolving iOS Settings URLs.
|
|
6
|
+
|
|
7
|
+
This type contains ONLY mapping logic and must not:
|
|
8
|
+
- interact with Capacitor
|
|
9
|
+
- open URLs
|
|
10
|
+
- perform side effects
|
|
11
|
+
*/
|
|
12
|
+
enum SettingsUtils {
|
|
13
|
+
|
|
14
|
+
static func resolveSettingsURL(for option: String?) -> URL? {
|
|
15
|
+
guard let option else {
|
|
16
|
+
return nil
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
let settingsPaths: [String: String] = [
|
|
20
|
+
"about": "App-prefs:General&path=About",
|
|
21
|
+
"autoLock": "App-prefs:General&path=AUTOLOCK",
|
|
22
|
+
"bluetooth": "App-prefs:Bluetooth",
|
|
23
|
+
"dateTime": "App-prefs:General&path=DATE_AND_TIME",
|
|
24
|
+
"facetime": "App-prefs:FACETIME",
|
|
25
|
+
"general": "App-prefs:General",
|
|
26
|
+
"keyboard": "App-prefs:General&path=Keyboard",
|
|
27
|
+
"iCloud": "App-prefs:CASTLE",
|
|
28
|
+
"iCloudStorageBackup": "App-prefs:CASTLE&path=STORAGE_AND_BACKUP",
|
|
29
|
+
"international": "App-prefs:General&path=INTERNATIONAL",
|
|
30
|
+
"locationServices": "App-prefs:Privacy&path=LOCATION",
|
|
31
|
+
"music": "App-prefs:MUSIC",
|
|
32
|
+
"notes": "App-prefs:NOTES",
|
|
33
|
+
"notifications": "App-prefs:NOTIFICATIONS_ID",
|
|
34
|
+
"phone": "App-prefs:Phone",
|
|
35
|
+
"photos": "App-prefs:Photos",
|
|
36
|
+
"managedConfigurationList": "App-prefs:General&path=ManagedConfigurationList",
|
|
37
|
+
"reset": "App-prefs:General&path=Reset",
|
|
38
|
+
"ringtone": "App-prefs:Sounds&path=Ringtone",
|
|
39
|
+
"sounds": "App-prefs:Sounds",
|
|
40
|
+
"softwareUpdate": "App-prefs:General&path=SOFTWARE_UPDATE_LINK",
|
|
41
|
+
"store": "App-prefs:STORE",
|
|
42
|
+
"tracking": "App-prefs:Privacy&path=USER_TRACKING",
|
|
43
|
+
"wallpaper": "App-prefs:Wallpaper",
|
|
44
|
+
"wifi": "App-prefs:WIFI",
|
|
45
|
+
"tethering": "App-prefs:INTERNET_TETHERING",
|
|
46
|
+
"doNotDisturb": "App-prefs:DO_NOT_DISTURB",
|
|
47
|
+
"touchIdPasscode": "App-prefs:TOUCHID_PASSCODE",
|
|
48
|
+
"screenTime": "App-prefs:SCREEN_TIME",
|
|
49
|
+
"accessibility": "App-prefs:ACCESSIBILITY",
|
|
50
|
+
"vpn": "App-prefs:VPN"
|
|
51
|
+
]
|
|
52
|
+
|
|
53
|
+
if let path = settingsPaths[option] {
|
|
54
|
+
return URL(string: path)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if option == "app" {
|
|
58
|
+
return URL(string: UIApplication.openSettingsURLString)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if option == "appNotification" {
|
|
62
|
+
if #available(iOS 16.0, *) {
|
|
63
|
+
return URL(string: UIApplication.openNotificationSettingsURLString)
|
|
64
|
+
}
|
|
65
|
+
return URL(string: UIApplication.openSettingsURLString)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return nil
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// This file is automatically generated. Do not modify manually.
|
|
2
|
+
import Foundation
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
Container for the plugin's version information.
|
|
6
|
+
This enum provides a centralized, single source of truth for the native
|
|
7
|
+
version string, synchronized directly from the project's 'package.json'.
|
|
8
|
+
It ensures parity across JavaScript, Android, and iOS platforms.
|
|
9
|
+
*/
|
|
10
|
+
public enum PluginVersion {
|
|
11
|
+
/**
|
|
12
|
+
The semantic version string of the plugin.
|
|
13
|
+
Value synchronized from package.json: "8.0.0-next.0"
|
|
14
|
+
*/
|
|
15
|
+
public static let number = "8.0.0-next.0"
|
|
16
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import XCTest
|
|
2
|
+
@testable import Settings
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
Basic functional tests for the Settings plugin native implementation.
|
|
6
|
+
|
|
7
|
+
These tests validate the core behavior of the implementation
|
|
8
|
+
independently from the Capacitor bridge.
|
|
9
|
+
*/
|
|
10
|
+
class SettingsPluginTests: XCTestCase {
|
|
11
|
+
func testEcho() {
|
|
12
|
+
// This is an example of a functional test case for a plugin.
|
|
13
|
+
// Use XCTAssert and related functions to verify your tests produce the correct results.
|
|
14
|
+
|
|
15
|
+
let implementation = SettingsImpl()
|
|
16
|
+
let value = "Hello, World!"
|
|
17
|
+
let result = implementation.echo(value)
|
|
18
|
+
|
|
19
|
+
XCTAssertEqual(value, result)
|
|
20
|
+
}
|
|
21
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@cap-kit/settings",
|
|
3
|
+
"version": "8.0.0-next.0",
|
|
4
|
+
"description": "Capacitor plugin to open app and system settings on iOS and Android.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"private": false,
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=24.0.0",
|
|
9
|
+
"pnpm": ">=10.0.0"
|
|
10
|
+
},
|
|
11
|
+
"main": "dist/plugin.cjs.js",
|
|
12
|
+
"module": "dist/esm/index.js",
|
|
13
|
+
"types": "dist/esm/index.d.ts",
|
|
14
|
+
"unpkg": "dist/plugin.js",
|
|
15
|
+
"files": [
|
|
16
|
+
"android/src/main/",
|
|
17
|
+
"android/build.gradle",
|
|
18
|
+
"dist/",
|
|
19
|
+
"ios/Sources",
|
|
20
|
+
"ios/Tests",
|
|
21
|
+
"Package.swift",
|
|
22
|
+
"CapKitSettings.podspec",
|
|
23
|
+
"LICENSE"
|
|
24
|
+
],
|
|
25
|
+
"author": "CapKit Team",
|
|
26
|
+
"license": "MIT",
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "git+https://github.com/cap-kit/capacitor-plugins.git",
|
|
30
|
+
"directory": "packages/settings"
|
|
31
|
+
},
|
|
32
|
+
"bugs": {
|
|
33
|
+
"url": "https://github.com/cap-kit/capacitor-plugins/issues"
|
|
34
|
+
},
|
|
35
|
+
"homepage": "https://github.com/cap-kit/capacitor-plugins/tree/main/packages/settings#readme",
|
|
36
|
+
"keywords": [
|
|
37
|
+
"capacitor",
|
|
38
|
+
"capacitor-plugin",
|
|
39
|
+
"plugin",
|
|
40
|
+
"native",
|
|
41
|
+
"settings",
|
|
42
|
+
"cap-kit"
|
|
43
|
+
],
|
|
44
|
+
"publishConfig": {
|
|
45
|
+
"access": "public"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@capacitor/cli": "^8.0.2",
|
|
49
|
+
"@capacitor/android": "^8.0.2",
|
|
50
|
+
"@capacitor/core": "^8.0.2",
|
|
51
|
+
"@capacitor/docgen": "^0.3.1",
|
|
52
|
+
"@capacitor/ios": "^8.0.2",
|
|
53
|
+
"@eslint/eslintrc": "^3.3.3",
|
|
54
|
+
"@eslint/js": "^9.39.2",
|
|
55
|
+
"eslint": "^9.39.2",
|
|
56
|
+
"eslint-plugin-import": "^2.32.0",
|
|
57
|
+
"globals": "^17.2.0",
|
|
58
|
+
"prettier": "^3.8.1",
|
|
59
|
+
"prettier-plugin-java": "^2.8.1",
|
|
60
|
+
"rimraf": "^6.1.2",
|
|
61
|
+
"rollup": "^4.57.0",
|
|
62
|
+
"swiftlint": "^2.0.0",
|
|
63
|
+
"typescript": "^5.9.3",
|
|
64
|
+
"typescript-eslint": "^8.54.0"
|
|
65
|
+
},
|
|
66
|
+
"peerDependencies": {
|
|
67
|
+
"@capacitor/core": ">=8.0.2"
|
|
68
|
+
},
|
|
69
|
+
"capacitor": {
|
|
70
|
+
"ios": {
|
|
71
|
+
"src": "ios"
|
|
72
|
+
},
|
|
73
|
+
"android": {
|
|
74
|
+
"src": "android"
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"scripts": {
|
|
78
|
+
"verify": "pnpm run verify:ios && pnpm run verify:android && pnpm run verify:web",
|
|
79
|
+
"verify:ios": "node ./scripts/sync-version.js && xcodebuild -scheme CapKitSettings -destination generic/platform=iOS",
|
|
80
|
+
"verify:android": "cd android && ./gradlew clean build test && cd ..",
|
|
81
|
+
"verify:web": "pnpm run build",
|
|
82
|
+
"lint:android": "cd android && ./gradlew ktlintCheck",
|
|
83
|
+
"fmt:android": "cd android && ./gradlew ktlintFormat",
|
|
84
|
+
"lint": "pnpm run eslint . && pnpm run swiftlint lint --strict || true && pnpm run lint:android || true",
|
|
85
|
+
"format:check": "prettier --check \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java",
|
|
86
|
+
"format": "eslint --fix . && prettier --write \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java && pnpm run swiftlint --fix --format && pnpm run fmt:android",
|
|
87
|
+
"eslint": "eslint",
|
|
88
|
+
"prettier": "prettier \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java",
|
|
89
|
+
"swiftlint": "node-swiftlint lint ios/Sources",
|
|
90
|
+
"docgen": "docgen --api SettingsPlugin --output-readme README.md --output-json dist/docs.json",
|
|
91
|
+
"build": "node ./scripts/sync-version.js && pnpm run clean && pnpm run docgen && tsc && rollup -c rollup.config.mjs",
|
|
92
|
+
"clean": "rimraf ./dist",
|
|
93
|
+
"watch": "tsc --watch",
|
|
94
|
+
"test": "pnpm run verify",
|
|
95
|
+
"removePacked": "rimraf -g cap-kit-settings-*.tgz",
|
|
96
|
+
"publish:locally": "pnpm run removePacked && pnpm run build && pnpm pack"
|
|
97
|
+
}
|
|
98
|
+
}
|