diff --git a/Cargo.lock b/Cargo.lock index f83571e2..3ea929e8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -239,6 +239,7 @@ dependencies = [ "tauri-build", "tauri-plugin-app", "tauri-plugin-barcode-scanner", + "tauri-plugin-biometric", "tauri-plugin-cli", "tauri-plugin-clipboard-manager", "tauri-plugin-dialog", @@ -5691,6 +5692,18 @@ dependencies = [ "thiserror", ] +[[package]] +name = "tauri-plugin-biometric" +version = "1.0.0" +dependencies = [ + "log", + "serde", + "serde_json", + "tauri", + "tauri-build", + "thiserror", +] + [[package]] name = "tauri-plugin-cli" version = "2.0.0-alpha.2" diff --git a/examples/api/package.json b/examples/api/package.json index 27bc5a39..416da889 100644 --- a/examples/api/package.json +++ b/examples/api/package.json @@ -12,6 +12,7 @@ "@tauri-apps/api": "2.0.0-alpha.8", "@tauri-apps/plugin-app": "2.0.0-alpha.1", "@tauri-apps/plugin-barcode-scanner": "2.0.0-alpha.0", + "@tauri-apps/plugin-biometric": "1.0.0", "@tauri-apps/plugin-cli": "2.0.0-alpha.1", "@tauri-apps/plugin-clipboard-manager": "2.0.0-alpha.1", "@tauri-apps/plugin-dialog": "2.0.0-alpha.1", diff --git a/examples/api/src-tauri/Cargo.toml b/examples/api/src-tauri/Cargo.toml index 8fb867f5..7815c382 100644 --- a/examples/api/src-tauri/Cargo.toml +++ b/examples/api/src-tauri/Cargo.toml @@ -48,6 +48,7 @@ tauri-plugin-updater = { path = "../../../plugins/updater", version = "2.0.0-alp [target."cfg(any(target_os = \"android\", target_os = \"ios\"))".dependencies] tauri-plugin-barcode-scanner = { path = "../../../plugins/barcode-scanner/", version = "2.0.0-alpha.0" } +tauri-plugin-biometric = { path = "../../../plugins/biometric/", version = "1.0.0" } [target."cfg(target_os = \"windows\")".dependencies] window-shadows = "0.2" diff --git a/examples/api/src-tauri/src/lib.rs b/examples/api/src-tauri/src/lib.rs index 2e04967a..b8b4d2e4 100644 --- a/examples/api/src-tauri/src/lib.rs +++ b/examples/api/src-tauri/src/lib.rs @@ -54,6 +54,7 @@ pub fn run() { #[cfg(mobile)] { app.handle().plugin(tauri_plugin_barcode_scanner::init())?; + app.handle().plugin(tauri_plugin_biometric::init())?; } let mut window_builder = WindowBuilder::new(app, "main", WindowUrl::default()); diff --git a/plugins/biometric/.gitignore b/plugins/biometric/.gitignore new file mode 100644 index 00000000..1b0b469d --- /dev/null +++ b/plugins/biometric/.gitignore @@ -0,0 +1 @@ +/.tauri diff --git a/plugins/biometric/Cargo.toml b/plugins/biometric/Cargo.toml new file mode 100644 index 00000000..facc80b8 --- /dev/null +++ b/plugins/biometric/Cargo.toml @@ -0,0 +1,22 @@ +[package] +name = "tauri-plugin-biometric" +version = "1.0.0" +edition = { workspace = true } +authors = { workspace = true } +license = { workspace = true } +links = "tauri-plugin-biometric" + +[package.metadata.docs.rs] +features = [ "tauri/dox" ] + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[build-dependencies] +tauri-build = { workspace = true } + +[dependencies] +serde = { workspace = true } +serde_json = { workspace = true } +tauri = { workspace = true } +log = { workspace = true } +thiserror = { workspace = true } diff --git a/plugins/biometric/LICENSE.spdx b/plugins/biometric/LICENSE.spdx new file mode 100644 index 00000000..cdd0df5a --- /dev/null +++ b/plugins/biometric/LICENSE.spdx @@ -0,0 +1,20 @@ +SPDXVersion: SPDX-2.1 +DataLicense: CC0-1.0 +PackageName: tauri +DataFormat: SPDXRef-1 +PackageSupplier: Organization: The Tauri Programme in the Commons Conservancy +PackageHomePage: https://tauri.app +PackageLicenseDeclared: Apache-2.0 +PackageLicenseDeclared: MIT +PackageCopyrightText: 2019-2022, The Tauri Programme in the Commons Conservancy +PackageSummary: Tauri is a rust project that enables developers to make secure +and small desktop applications using a web frontend. + +PackageComment: The package includes the following libraries; see +Relationship information. + +Created: 2019-05-20T09:00:00Z +PackageDownloadLocation: git://github.com/tauri-apps/tauri +PackageDownloadLocation: git+https://github.com/tauri-apps/tauri.git +PackageDownloadLocation: git+ssh://github.com/tauri-apps/tauri.git +Creator: Person: Daniel Thompson-Yvetot \ No newline at end of file diff --git a/plugins/biometric/LICENSE_APACHE-2.0 b/plugins/biometric/LICENSE_APACHE-2.0 new file mode 100644 index 00000000..4947287f --- /dev/null +++ b/plugins/biometric/LICENSE_APACHE-2.0 @@ -0,0 +1,177 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/plugins/biometric/LICENSE_MIT b/plugins/biometric/LICENSE_MIT new file mode 100644 index 00000000..4d754725 --- /dev/null +++ b/plugins/biometric/LICENSE_MIT @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 - Present Tauri Apps Contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/plugins/biometric/README.md b/plugins/biometric/README.md new file mode 100644 index 00000000..1f057833 --- /dev/null +++ b/plugins/biometric/README.md @@ -0,0 +1,76 @@ +![biometric](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/biometric/banner.png) + + + +## Install + +_This plugin requires a Rust version of at least **1.65**_ + +There are three general methods of installation that we can recommend. + +1. Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked) +2. Pull sources directly from Github using git tags / revision hashes (most secure) +3. Git submodule install this repo in your tauri project and then use file protocol to ingest the source (most secure, but inconvenient to use) + +Install the Core plugin by adding the following to your `Cargo.toml` file: + +`src-tauri/Cargo.toml` + +```toml +[dependencies] +tauri-plugin-biometric = "2.0.0-alpha" +# alternatively with Git: +tauri-plugin-biometric = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } +``` + +You can install the JavaScript Guest bindings using your preferred JavaScript package manager: + +> Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use. + + + +```sh +pnpm add @tauri-apps/plugin-biometric +# or +npm add @tauri-apps/plugin-biometric +# or +yarn add @tauri-apps/plugin-biometric + +# alternatively with Git: +pnpm add https://github.com/tauri-apps/tauri-plugin-biometric#v2 +# or +npm add https://github.com/tauri-apps/tauri-plugin-biometric#v2 +# or +yarn add https://github.com/tauri-apps/tauri-plugin-biometric#v2 +``` + +## Usage + +First you need to register the core plugin with Tauri: + +`src-tauri/src/main.rs` + +```rust +fn main() { + tauri::Builder::default() + .plugin(tauri_plugin_biometric::init()) + .run(tauri::generate_context!()) + .expect("error while running tauri application"); +} +``` + +Afterwards all the plugin's APIs are available through the JavaScript guest bindings: + +```javascript + +``` + +## Contributing + +PRs accepted. Please make sure to read the Contributing Guide before making a pull request. + +## License + +Code: (c) 2015 - Present - The Tauri Programme within The Commons Conservancy. + +MIT or MIT/Apache 2.0 where applicable. diff --git a/plugins/biometric/android/.gitignore b/plugins/biometric/android/.gitignore new file mode 100644 index 00000000..c0f21ec2 --- /dev/null +++ b/plugins/biometric/android/.gitignore @@ -0,0 +1,2 @@ +/build +/.tauri diff --git a/plugins/biometric/android/build.gradle.kts b/plugins/biometric/android/build.gradle.kts new file mode 100644 index 00000000..2375f755 --- /dev/null +++ b/plugins/biometric/android/build.gradle.kts @@ -0,0 +1,45 @@ +plugins { + id("com.android.library") + id("org.jetbrains.kotlin.android") +} + +android { + namespace = "app.tauri.biometric" + compileSdk = 32 + + defaultConfig { + minSdk = 24 + targetSdk = 32 + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + consumerProguardFiles("consumer-rules.pro") + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = "1.8" + } +} + +dependencies { + + implementation("androidx.core:core-ktx:1.9.0") + implementation("androidx.appcompat:appcompat:1.6.0") + implementation("com.google.android.material:material:1.7.0") + testImplementation("junit:junit:4.13.2") + androidTestImplementation("androidx.test.ext:junit:1.1.5") + androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") + implementation(project(":tauri-android")) +} diff --git a/plugins/biometric/android/proguard-rules.pro b/plugins/biometric/android/proguard-rules.pro new file mode 100644 index 00000000..481bb434 --- /dev/null +++ b/plugins/biometric/android/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/plugins/biometric/android/settings.gradle b/plugins/biometric/android/settings.gradle new file mode 100644 index 00000000..14a752e4 --- /dev/null +++ b/plugins/biometric/android/settings.gradle @@ -0,0 +1,2 @@ +include ':tauri-android' +project(':tauri-android').projectDir = new File('./.tauri/tauri-api') diff --git a/plugins/biometric/android/src/androidTest/java/ExampleInstrumentedTest.kt b/plugins/biometric/android/src/androidTest/java/ExampleInstrumentedTest.kt new file mode 100644 index 00000000..5efaa023 --- /dev/null +++ b/plugins/biometric/android/src/androidTest/java/ExampleInstrumentedTest.kt @@ -0,0 +1,28 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +package app.tauri.biometric + +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.ext.junit.runners.AndroidJUnit4 + +import org.junit.Test +import org.junit.runner.RunWith + +import org.junit.Assert.* + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("app.tauri.biometric", appContext.packageName) + } +} diff --git a/plugins/biometric/android/src/main/AndroidManifest.xml b/plugins/biometric/android/src/main/AndroidManifest.xml new file mode 100644 index 00000000..9a40236b --- /dev/null +++ b/plugins/biometric/android/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/plugins/biometric/android/src/main/java/BiometricPlugin.kt b/plugins/biometric/android/src/main/java/BiometricPlugin.kt new file mode 100644 index 00000000..859ddcd8 --- /dev/null +++ b/plugins/biometric/android/src/main/java/BiometricPlugin.kt @@ -0,0 +1,23 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +package app.tauri.biometric + +import android.app.Activity +import app.tauri.annotation.Command +import app.tauri.annotation.TauriPlugin +import app.tauri.plugin.JSObject +import app.tauri.plugin.Plugin +import app.tauri.plugin.Invoke + +@TauriPlugin +class BiometricPlugin(private val activity: Activity): Plugin(activity) { + @Command + fun ping(invoke: Invoke) { + val value = invoke.getString("value") ?: "" + val ret = JSObject() + ret.put("value", value) + invoke.resolve(ret) + } +} diff --git a/plugins/biometric/android/src/test/java/ExampleUnitTest.kt b/plugins/biometric/android/src/test/java/ExampleUnitTest.kt new file mode 100644 index 00000000..128d8bce --- /dev/null +++ b/plugins/biometric/android/src/test/java/ExampleUnitTest.kt @@ -0,0 +1,21 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +package app.tauri.biometric + +import org.junit.Test + +import org.junit.Assert.* + +/** + * Example local unit test, which will execute on the development machine (host). + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +class ExampleUnitTest { + @Test + fun addition_isCorrect() { + assertEquals(4, 2 + 2) + } +} diff --git a/plugins/biometric/build.rs b/plugins/biometric/build.rs new file mode 100644 index 00000000..743096a6 --- /dev/null +++ b/plugins/biometric/build.rs @@ -0,0 +1,16 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use std::process::exit; + +fn main() { + if let Err(error) = tauri_build::mobile::PluginBuilder::new() + .android_path("android") + .ios_path("ios") + .run() + { + println!("{error:#}"); + exit(1); + } +} diff --git a/plugins/biometric/guest-js/index.ts b/plugins/biometric/guest-js/index.ts new file mode 100644 index 00000000..6b1d80ff --- /dev/null +++ b/plugins/biometric/guest-js/index.ts @@ -0,0 +1,5 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +export async function doSomething() {} diff --git a/plugins/biometric/ios/.gitignore b/plugins/biometric/ios/.gitignore new file mode 100644 index 00000000..5922fdaa --- /dev/null +++ b/plugins/biometric/ios/.gitignore @@ -0,0 +1,10 @@ +.DS_Store +/.build +/Packages +/*.xcodeproj +xcuserdata/ +DerivedData/ +.swiftpm/config/registries.json +.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata +.netrc +Package.resolved diff --git a/plugins/biometric/ios/Package.swift b/plugins/biometric/ios/Package.swift new file mode 100644 index 00000000..34c9f87e --- /dev/null +++ b/plugins/biometric/ios/Package.swift @@ -0,0 +1,33 @@ +// swift-tools-version:5.3 +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +import PackageDescription + +let package = Package( + name: "tauri-plugin-biometric", + platforms: [ + .iOS(.v13) + ], + products: [ + // Products define the executables and libraries a package produces, and make them visible to other packages. + .library( + name: "tauri-plugin-biometric", + type: .static, + targets: ["tauri-plugin-biometric"]) + ], + dependencies: [ + .package(name: "Tauri", path: "../.tauri/tauri-api") + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + // Targets can depend on other targets in this package, and on products in packages this package depends on. + .target( + name: "tauri-plugin-biometric", + dependencies: [ + .byName(name: "Tauri") + ], + path: "Sources") + ] +) diff --git a/plugins/biometric/ios/README.md b/plugins/biometric/ios/README.md new file mode 100644 index 00000000..f4900bdd --- /dev/null +++ b/plugins/biometric/ios/README.md @@ -0,0 +1,3 @@ +# Tauri Plugin {{ plugin_name_original }} + +A description of this package. diff --git a/plugins/biometric/ios/Sources/BiometricPlugin.swift b/plugins/biometric/ios/Sources/BiometricPlugin.swift new file mode 100644 index 00000000..8ffadd23 --- /dev/null +++ b/plugins/biometric/ios/Sources/BiometricPlugin.swift @@ -0,0 +1,20 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +import SwiftRs +import Tauri +import UIKit +import WebKit + +class BiometricPlugin: Plugin { + @objc public func ping(_ invoke: Invoke) throws { + let value = invoke.getString("value") + invoke.resolve(["value": value as Any]) + } +} + +@_cdecl("init_plugin_biometric") +func initPlugin() -> Plugin { + return BiometricPlugin() +} diff --git a/plugins/biometric/ios/Tests/PluginTests/PluginTests.swift b/plugins/biometric/ios/Tests/PluginTests/PluginTests.swift new file mode 100644 index 00000000..99992ce4 --- /dev/null +++ b/plugins/biometric/ios/Tests/PluginTests/PluginTests.swift @@ -0,0 +1,12 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +import XCTest +@testable import ExamplePlugin + +final class ExamplePluginTests: XCTestCase { + func testExample() throws { + let plugin = ExamplePlugin() + } +} diff --git a/plugins/biometric/package.json b/plugins/biometric/package.json new file mode 100644 index 00000000..eed1ea01 --- /dev/null +++ b/plugins/biometric/package.json @@ -0,0 +1,32 @@ +{ + "name": "@tauri-apps/plugin-biometric", + "version": "1.0.0", + "license": "MIT or APACHE-2.0", + "authors": [ + "Tauri Programme within The Commons Conservancy" + ], + "type": "module", + "browser": "dist-js/index.min.js", + "module": "dist-js/index.mjs", + "types": "dist-js/index.d.ts", + "exports": { + "import": "./dist-js/index.mjs", + "types": "./dist-js/index.d.ts", + "browser": "./dist-js/index.min.js" + }, + "scripts": { + "build": "rollup -c" + }, + "files": [ + "dist-js", + "!dist-js/**/*.map", + "README.md", + "LICENSE" + ], + "devDependencies": { + "tslib": "2.6.0" + }, + "dependencies": { + "@tauri-apps/api": "2.0.0-alpha.8" + } +} diff --git a/plugins/biometric/rollup.config.mjs b/plugins/biometric/rollup.config.mjs new file mode 100644 index 00000000..99a3dd31 --- /dev/null +++ b/plugins/biometric/rollup.config.mjs @@ -0,0 +1,11 @@ +import { readFileSync } from "fs"; + +import { createConfig } from "../../shared/rollup.config.mjs"; + +export default createConfig({ + input: "guest-js/index.ts", + pkg: JSON.parse( + readFileSync(new URL("./package.json", import.meta.url), "utf8"), + ), + external: [/^@tauri-apps\/api/], +}); diff --git a/plugins/biometric/src/api-iife.js b/plugins/biometric/src/api-iife.js new file mode 100644 index 00000000..e14c806b --- /dev/null +++ b/plugins/biometric/src/api-iife.js @@ -0,0 +1 @@ +if("__TAURI__"in window){var __TAURI_BIOMETRIC__=function(_){"use strict";return _.doSomething=async function(){},_}({});Object.defineProperty(window.__TAURI__,"biometric",{value:__TAURI_BIOMETRIC__})} diff --git a/plugins/biometric/src/commands.rs b/plugins/biometric/src/commands.rs new file mode 100644 index 00000000..99cc0eaf --- /dev/null +++ b/plugins/biometric/src/commands.rs @@ -0,0 +1,15 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use tauri::{AppHandle, command, Runtime, Window}; + +use crate::Result; + +#[command] +pub(crate) async fn execute( + _app: AppHandle, + _window: Window, +) -> Result { + Ok("success".to_string()) +} diff --git a/plugins/biometric/src/error.rs b/plugins/biometric/src/error.rs new file mode 100644 index 00000000..339e763b --- /dev/null +++ b/plugins/biometric/src/error.rs @@ -0,0 +1,25 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use serde::{ser::Serializer, Serialize}; + +pub type Result = std::result::Result; + +#[derive(Debug, thiserror::Error)] +pub enum Error { + #[error(transparent)] + Io(#[from] std::io::Error), + #[cfg(mobile)] + #[error(transparent)] + PluginInvoke(#[from] tauri::plugin::mobile::PluginInvokeError), +} + +impl Serialize for Error { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + serializer.serialize_str(self.to_string().as_ref()) + } +} diff --git a/plugins/biometric/src/lib.rs b/plugins/biometric/src/lib.rs new file mode 100644 index 00000000..6f6f8410 --- /dev/null +++ b/plugins/biometric/src/lib.rs @@ -0,0 +1,62 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +#![cfg(mobile)] + +use tauri::{ + plugin::{Builder, PluginHandle, TauriPlugin}, + Manager, Runtime, +}; + +pub use models::*; + +mod commands; +mod error; +mod models; + +pub use error::{Error, Result}; + +#[cfg(target_os = "android")] +const PLUGIN_IDENTIFIER: &str = "app.tauri.biometric"; + +#[cfg(target_os = "ios")] +tauri::ios_plugin_binding!(init_plugin_biometric); + +/// Access to the biometric APIs. +pub struct Biometric(PluginHandle); + +impl Biometric { + pub fn ping(&self, payload: PingRequest) -> crate::Result { + self.0 + .run_mobile_plugin("ping", payload) + .map_err(Into::into) + } +} + +/// Extensions to [`tauri::App`], [`tauri::AppHandle`] and [`tauri::Window`] to access the biometric APIs. +pub trait BiometricExt { + fn biometric(&self) -> &Biometric; +} + +impl> crate::BiometricExt for T { + fn biometric(&self) -> &Biometric { + self.state::>().inner() + } +} + +/// Initializes the plugin. +pub fn init() -> TauriPlugin { + Builder::new("biometric") + .js_init_script(include_str!("api-iife.js").to_string()) + .invoke_handler(tauri::generate_handler![commands::execute]) + .setup(|app, api| { + #[cfg(target_os = "android")] + let handle = api.register_android_plugin(PLUGIN_IDENTIFIER, "BiometricPlugin")?; + #[cfg(target_os = "ios")] + let handle = api.register_ios_plugin(init_plugin_biometric)?; + app.manage(Biometric(handle)); + Ok(()) + }) + .build() +} diff --git a/plugins/biometric/src/models.rs b/plugins/biometric/src/models.rs new file mode 100644 index 00000000..d50dcf91 --- /dev/null +++ b/plugins/biometric/src/models.rs @@ -0,0 +1,17 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use serde::{Deserialize, Serialize}; + +#[derive(Debug, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct PingRequest { + pub value: Option, +} + +#[derive(Debug, Clone, Default, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct PingResponse { + pub value: Option, +} diff --git a/plugins/biometric/tsconfig.json b/plugins/biometric/tsconfig.json new file mode 100644 index 00000000..5098169a --- /dev/null +++ b/plugins/biometric/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../../tsconfig.base.json", + "include": ["guest-js/*.ts"] +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b0b1af71..e34286e3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -72,6 +72,9 @@ importers: '@tauri-apps/plugin-barcode-scanner': specifier: 2.0.0-alpha.0 version: link:../../plugins/barcode-scanner + '@tauri-apps/plugin-biometric': + specifier: 1.0.0 + version: link:../../plugins/biometric '@tauri-apps/plugin-cli': specifier: 2.0.0-alpha.1 version: link:../../plugins/cli @@ -135,7 +138,7 @@ importers: version: 3.59.1 unocss: specifier: ^0.53.1 - version: 0.53.1(postcss@8.4.26)(vite@4.4.4) + version: 0.53.1(postcss@8.4.26)(rollup@3.26.3)(vite@4.4.4) vite: specifier: ^4.3.9 version: 4.4.4 @@ -180,6 +183,16 @@ importers: specifier: ^2.5.0 version: 2.6.0 + plugins/biometric: + dependencies: + '@tauri-apps/api': + specifier: 2.0.0-alpha.8 + version: 2.0.0-alpha.8 + devDependencies: + tslib: + specifier: 2.6.0 + version: 2.6.0 + plugins/cli: dependencies: '@tauri-apps/api': @@ -592,7 +605,7 @@ packages: peerDependencies: mocha: ^10.0.0 dependencies: - effection: 2.0.7 + effection: 2.0.7(mocha@10.2.0) mocha: 10.2.0 dev: true @@ -1037,7 +1050,7 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: ajv: 6.12.6 - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) espree: 9.6.1 globals: 13.20.0 ignore: 5.2.4 @@ -1059,7 +1072,7 @@ packages: engines: {node: '>=10.10.0'} dependencies: '@humanwhocodes/object-schema': 1.2.1 - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) minimatch: 3.1.2 transitivePeerDependencies: - supports-color @@ -1100,7 +1113,7 @@ packages: '@antfu/install-pkg': 0.1.1 '@antfu/utils': 0.7.5 '@iconify/types': 2.0.0 - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) kolorist: 1.8.0 local-pkg: 0.4.3 transitivePeerDependencies: @@ -1225,20 +1238,6 @@ packages: typescript: 5.1.6 dev: true - /@rollup/pluginutils@5.0.2: - resolution: {integrity: sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==} - engines: {node: '>=14.0.0'} - peerDependencies: - rollup: ^1.20.0||^2.0.0||^3.0.0 - peerDependenciesMeta: - rollup: - optional: true - dependencies: - '@types/estree': 1.0.1 - estree-walker: 2.0.2 - picomatch: 2.3.1 - dev: true - /@rollup/pluginutils@5.0.2(rollup@3.26.3): resolution: {integrity: sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==} engines: {node: '>=14.0.0'} @@ -1298,7 +1297,7 @@ packages: vite: ^4.0.0 dependencies: '@sveltejs/vite-plugin-svelte': 2.4.1(svelte@3.59.1)(vite@4.4.4) - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) svelte: 3.59.1 vite: 4.4.4 transitivePeerDependencies: @@ -1314,7 +1313,7 @@ packages: vite: ^4.0.0 dependencies: '@sveltejs/vite-plugin-svelte': 2.4.2(svelte@4.0.5)(vite@4.4.4) - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) svelte: 4.0.5 vite: 4.4.4 transitivePeerDependencies: @@ -1329,7 +1328,7 @@ packages: vite: ^4.0.0 dependencies: '@sveltejs/vite-plugin-svelte-inspector': 1.0.3(@sveltejs/vite-plugin-svelte@2.4.1)(svelte@3.59.1)(vite@4.4.4) - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) deepmerge: 4.3.1 kleur: 4.1.5 magic-string: 0.30.1 @@ -1349,7 +1348,7 @@ packages: vite: ^4.0.0 dependencies: '@sveltejs/vite-plugin-svelte-inspector': 1.0.3(@sveltejs/vite-plugin-svelte@2.4.2)(svelte@4.0.5)(vite@4.4.4) - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) deepmerge: 4.3.1 kleur: 4.1.5 magic-string: 0.30.1 @@ -1371,7 +1370,7 @@ packages: engines: {node: '>= 14.6.0', npm: '>= 6.6.0', yarn: '>= 1.19.1'} dev: false - /@tauri-apps/cli-darwin-arm64@2.0.0-alpha.15: + /@tauri-apps/cli-darwin-arm64@2.0.0-alpha.14: resolution: {integrity: sha512-3K416rvSUt8el/fdPnSnHJOI2j5Os9Kyy17XZp+z3PKRRuo/iJPp9L3w0zFGYsh7C+ylzV4OBUSVTi+e+gO5qA==} engines: {node: '>= 10'} cpu: [arm64] @@ -1380,7 +1379,7 @@ packages: dev: true optional: true - /@tauri-apps/cli-darwin-x64@2.0.0-alpha.15: + /@tauri-apps/cli-darwin-x64@2.0.0-alpha.14: resolution: {integrity: sha512-aLEUGG8Z0UpTENe4/UG6DU8bnB2e1uxyxYvcmFKrHv+EAtR9nLH14alBxPl2K54YXy3JLR4bKROW15a/sFrX9g==} engines: {node: '>= 10'} cpu: [x64] @@ -1389,7 +1388,7 @@ packages: dev: true optional: true - /@tauri-apps/cli-linux-arm-gnueabihf@2.0.0-alpha.15: + /@tauri-apps/cli-linux-arm-gnueabihf@2.0.0-alpha.14: resolution: {integrity: sha512-Lu7unNvurBccxfHIaUQ0gPgUioTkQBMtWGrqO/auZ/JbjPR1W2eBlRwVNXf+nBWX9HwomPR3YD5yZuZmzxRV2g==} engines: {node: '>= 10'} cpu: [arm] @@ -1398,7 +1397,7 @@ packages: dev: true optional: true - /@tauri-apps/cli-linux-arm64-gnu@2.0.0-alpha.15: + /@tauri-apps/cli-linux-arm64-gnu@2.0.0-alpha.14: resolution: {integrity: sha512-g8HkwKvAsWLLMJzPup7B1BCilYmXKwXdee7sf8QFbaIUSccR8i5pXLK5N/quKw5lmldYgFveEyuW9Qs8RgTYnQ==} engines: {node: '>= 10'} cpu: [arm64] @@ -1407,7 +1406,7 @@ packages: dev: true optional: true - /@tauri-apps/cli-linux-arm64-musl@2.0.0-alpha.15: + /@tauri-apps/cli-linux-arm64-musl@2.0.0-alpha.14: resolution: {integrity: sha512-ag4UuX6zg7vmBFWmg9ChyiJI7GTMkc8tjr/qobd3Lg9ddmjnVWwLUHt6v1kYhXiU7iLPD5DYDIjU8x/POc3hSA==} engines: {node: '>= 10'} cpu: [arm64] @@ -1416,7 +1415,7 @@ packages: dev: true optional: true - /@tauri-apps/cli-linux-x64-gnu@2.0.0-alpha.15: + /@tauri-apps/cli-linux-x64-gnu@2.0.0-alpha.14: resolution: {integrity: sha512-+CviROc4fzrGqqyHQXh3uc2dGr/oYr19I8r2k+LJ2CDfmtj7CbNd/oC5oehHbHdw1oGFKuDPudrTGvzdRNygYA==} engines: {node: '>= 10'} cpu: [x64] @@ -1425,7 +1424,7 @@ packages: dev: true optional: true - /@tauri-apps/cli-linux-x64-musl@2.0.0-alpha.15: + /@tauri-apps/cli-linux-x64-musl@2.0.0-alpha.14: resolution: {integrity: sha512-aCP51HOAQXgVhyPHXKy627bYVRkNnpCvSU3L03pYV8YDoGo+veeuek5UiW7PlNdwx52B/yC3Jz7Dr3gEbFimfQ==} engines: {node: '>= 10'} cpu: [x64] @@ -1434,7 +1433,7 @@ packages: dev: true optional: true - /@tauri-apps/cli-win32-arm64-msvc@2.0.0-alpha.15: + /@tauri-apps/cli-win32-arm64-msvc@2.0.0-alpha.14: resolution: {integrity: sha512-b6Ei5ERUF0KS1bttM7i6U62GmjIvlgK03XZqvL/KLNvUfqRMu8F7JA1ejSExgTxhEhKSWA768HiTXpXk2GjFFw==} engines: {node: '>= 10'} cpu: [arm64] @@ -1443,7 +1442,7 @@ packages: dev: true optional: true - /@tauri-apps/cli-win32-ia32-msvc@2.0.0-alpha.15: + /@tauri-apps/cli-win32-ia32-msvc@2.0.0-alpha.14: resolution: {integrity: sha512-TDkvu5pd37bKxZ6N+BqngCNGcefY7aHxyJ3BdBGxF+wRMjEMh70mgEXk8i0uM/aUi/Kl1GQoO6xJfUDlIMPXOA==} engines: {node: '>= 10'} cpu: [ia32] @@ -1452,7 +1451,7 @@ packages: dev: true optional: true - /@tauri-apps/cli-win32-x64-msvc@2.0.0-alpha.15: + /@tauri-apps/cli-win32-x64-msvc@2.0.0-alpha.14: resolution: {integrity: sha512-9yfoEe2RSykKr5hCifVAL5o0gHXgRCS+Wo+RJjQ9L2+QHY7XPLZYAhj/h8jdcAdRveyIQwat3k7wl+SW87v1eg==} engines: {node: '>= 10'} cpu: [x64] @@ -1462,20 +1461,20 @@ packages: optional: true /@tauri-apps/cli@2.0.0-alpha.15: - resolution: {integrity: sha512-4/IQwN5S94D6LTXQrDWbSea0pGb9TTC4BwxHUFmhep4NjFxms161v1zadAUIsq/N2x6WwCBGrsdq9SIkgKv49Q==} + resolution: {integrity: sha512-4/IQwN5S94D6LTXQrDWbSea0pGb9TTC4BwxHUFmhep4NjFxms161v1zadAUIsq/N2x6WwCBGrsdq9SIkgKv49Q==, tarball: https://registry.npmjs.org/@tauri-apps/cli/-/cli-2.0.0-alpha.15.tgz} engines: {node: '>= 10'} hasBin: true optionalDependencies: - '@tauri-apps/cli-darwin-arm64': 2.0.0-alpha.15 - '@tauri-apps/cli-darwin-x64': 2.0.0-alpha.15 - '@tauri-apps/cli-linux-arm-gnueabihf': 2.0.0-alpha.15 - '@tauri-apps/cli-linux-arm64-gnu': 2.0.0-alpha.15 - '@tauri-apps/cli-linux-arm64-musl': 2.0.0-alpha.15 - '@tauri-apps/cli-linux-x64-gnu': 2.0.0-alpha.15 - '@tauri-apps/cli-linux-x64-musl': 2.0.0-alpha.15 - '@tauri-apps/cli-win32-arm64-msvc': 2.0.0-alpha.15 - '@tauri-apps/cli-win32-ia32-msvc': 2.0.0-alpha.15 - '@tauri-apps/cli-win32-x64-msvc': 2.0.0-alpha.15 + '@tauri-apps/cli-darwin-arm64': 2.0.0-alpha.14 + '@tauri-apps/cli-darwin-x64': 2.0.0-alpha.14 + '@tauri-apps/cli-linux-arm-gnueabihf': 2.0.0-alpha.14 + '@tauri-apps/cli-linux-arm64-gnu': 2.0.0-alpha.14 + '@tauri-apps/cli-linux-arm64-musl': 2.0.0-alpha.14 + '@tauri-apps/cli-linux-x64-gnu': 2.0.0-alpha.14 + '@tauri-apps/cli-linux-x64-musl': 2.0.0-alpha.14 + '@tauri-apps/cli-win32-arm64-msvc': 2.0.0-alpha.14 + '@tauri-apps/cli-win32-ia32-msvc': 2.0.0-alpha.14 + '@tauri-apps/cli-win32-x64-msvc': 2.0.0-alpha.14 dev: true /@tauri-apps/toml@2.2.4: @@ -1537,7 +1536,7 @@ packages: '@typescript-eslint/type-utils': 6.1.0(eslint@8.45.0)(typescript@5.1.6) '@typescript-eslint/utils': 6.1.0(eslint@8.45.0)(typescript@5.1.6) '@typescript-eslint/visitor-keys': 6.1.0 - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) eslint: 8.45.0 graphemer: 1.4.0 ignore: 5.2.4 @@ -1563,7 +1562,7 @@ packages: '@typescript-eslint/scope-manager': 5.62.0 '@typescript-eslint/types': 5.62.0 '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.1.6) - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) eslint: 8.45.0 typescript: 5.1.6 transitivePeerDependencies: @@ -1584,7 +1583,7 @@ packages: '@typescript-eslint/types': 6.1.0 '@typescript-eslint/typescript-estree': 6.1.0(typescript@5.1.6) '@typescript-eslint/visitor-keys': 6.1.0 - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) eslint: 8.45.0 typescript: 5.1.6 transitivePeerDependencies: @@ -1619,7 +1618,7 @@ packages: dependencies: '@typescript-eslint/typescript-estree': 6.1.0(typescript@5.1.6) '@typescript-eslint/utils': 6.1.0(eslint@8.45.0)(typescript@5.1.6) - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) eslint: 8.45.0 ts-api-utils: 1.0.1(typescript@5.1.6) typescript: 5.1.6 @@ -1648,7 +1647,7 @@ packages: dependencies: '@typescript-eslint/types': 5.62.0 '@typescript-eslint/visitor-keys': 5.62.0 - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) globby: 11.1.0 is-glob: 4.0.3 semver: 7.5.4 @@ -1669,7 +1668,7 @@ packages: dependencies: '@typescript-eslint/types': 6.1.0 '@typescript-eslint/visitor-keys': 6.1.0 - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) globby: 11.1.0 is-glob: 4.0.3 semver: 7.5.4 @@ -1714,24 +1713,24 @@ packages: eslint-visitor-keys: 3.4.1 dev: true - /@unocss/astro@0.53.1(vite@4.4.4): + /@unocss/astro@0.53.1(rollup@3.26.3)(vite@4.4.4): resolution: {integrity: sha512-dvPH2buCL0qvWXFfQFUeB8kbbJsliN0ib2Am5/1r4XyOwCiCvfwc3UuQpsi0xJs/WO9QgIxLWxakxVj3DeAuAQ==} dependencies: '@unocss/core': 0.53.1 '@unocss/reset': 0.53.1 - '@unocss/vite': 0.53.1(vite@4.4.4) + '@unocss/vite': 0.53.1(rollup@3.26.3)(vite@4.4.4) transitivePeerDependencies: - rollup - vite dev: true - /@unocss/cli@0.53.1: + /@unocss/cli@0.53.1(rollup@3.26.3): resolution: {integrity: sha512-K2r8eBtwv1oQ6KcDLb3KyIDaApVle3zbckZmd7W402/IRIJSKScLjxWHtEJpnYEyuxD5MlQpfRZLZgmWWVMOsg==} engines: {node: '>=14'} hasBin: true dependencies: '@ampproject/remapping': 2.2.1 - '@rollup/pluginutils': 5.0.2 + '@rollup/pluginutils': 5.0.2(rollup@3.26.3) '@unocss/config': 0.53.1 '@unocss/core': 0.53.1 '@unocss/preset-uno': 0.53.1 @@ -1887,13 +1886,13 @@ packages: '@unocss/core': 0.53.1 dev: true - /@unocss/vite@0.53.1(vite@4.4.4): + /@unocss/vite@0.53.1(rollup@3.26.3)(vite@4.4.4): resolution: {integrity: sha512-/N/rjiFyj1ejK1ZQIv9N/NMsNE6i2/V8ISwYhbGxLpc3Sca4jeVjZPsx5cg5DN9Ddas2BRH3YhLhdh8rPUPzxQ==} peerDependencies: vite: ^2.9.0 || ^3.0.0-0 || ^4.0.0 dependencies: '@ampproject/remapping': 2.2.1 - '@rollup/pluginutils': 5.0.2 + '@rollup/pluginutils': 5.0.2(rollup@3.26.3) '@unocss/config': 0.53.1 '@unocss/core': 0.53.1 '@unocss/inspector': 0.53.1 @@ -2359,18 +2358,6 @@ packages: ms: 2.1.3 dev: true - /debug@4.3.4: - resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - dependencies: - ms: 2.1.2 - dev: true - /debug@4.3.4(supports-color@8.1.1): resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} engines: {node: '>=6.0'} @@ -2478,18 +2465,6 @@ packages: resolution: {integrity: sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==} dev: true - /effection@2.0.7: - resolution: {integrity: sha512-I9ndFvtByvHbvOHwMp1NM7vlLDT0RBOu1YlIfBece46VASSot0oPnAfoGdc1YKoQShQLjigvHZ6OqZYUAxUcXg==} - dependencies: - '@effection/channel': 2.0.5 - '@effection/core': 2.2.2 - '@effection/events': 2.0.5 - '@effection/fetch': 2.0.6(mocha@10.2.0) - '@effection/main': 2.1.2 - '@effection/stream': 2.0.5 - '@effection/subscription': 2.0.5 - dev: true - /effection@2.0.7(mocha@10.2.0): resolution: {integrity: sha512-I9ndFvtByvHbvOHwMp1NM7vlLDT0RBOu1YlIfBece46VASSot0oPnAfoGdc1YKoQShQLjigvHZ6OqZYUAxUcXg==} dependencies: @@ -2846,7 +2821,7 @@ packages: ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.3 - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) doctrine: 3.0.0 escape-string-regexp: 4.0.0 eslint-scope: 7.2.1 @@ -3750,7 +3725,7 @@ packages: /micromark@2.11.4: resolution: {integrity: sha512-+WoovN/ppKolQOFIAajxi7Lu9kInbPxFuTBVEavFcL8eAfVstoc5MocPmqBeAdBOJV00uaVjegzH4+MA0DN/uA==} dependencies: - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) parse-entities: 2.0.0 transitivePeerDependencies: - supports-color @@ -4866,7 +4841,7 @@ packages: '@types/unist': 2.0.7 dev: true - /unocss@0.53.1(postcss@8.4.26)(vite@4.4.4): + /unocss@0.53.1(postcss@8.4.26)(rollup@3.26.3)(vite@4.4.4): resolution: {integrity: sha512-0lRblA8hX7VUu5dywbcStzm590Iz5ahSJGsMNKNH3+u9C7AfJcKT8epxjkIkJWQBNJLD5vsao4SuuhLWB7eMQQ==} engines: {node: '>=14'} peerDependencies: @@ -4875,8 +4850,8 @@ packages: '@unocss/webpack': optional: true dependencies: - '@unocss/astro': 0.53.1(vite@4.4.4) - '@unocss/cli': 0.53.1 + '@unocss/astro': 0.53.1(rollup@3.26.3)(vite@4.4.4) + '@unocss/cli': 0.53.1(rollup@3.26.3) '@unocss/core': 0.53.1 '@unocss/extractor-arbitrary-variants': 0.53.1 '@unocss/postcss': 0.53.1(postcss@8.4.26) @@ -4894,7 +4869,7 @@ packages: '@unocss/transformer-compile-class': 0.53.1 '@unocss/transformer-directives': 0.53.1 '@unocss/transformer-variant-group': 0.53.1 - '@unocss/vite': 0.53.1(vite@4.4.4) + '@unocss/vite': 0.53.1(rollup@3.26.3)(vite@4.4.4) transitivePeerDependencies: - postcss - rollup