From de72fa5e3eea26b6ad5e35ea77cadb6bceaed291 Mon Sep 17 00:00:00 2001 From: rizky_denianto Date: Sat, 12 Sep 2026 21:44:37 +0700 Subject: [PATCH 1/2] Menyederhanakan cara meminta izin untuk menggunakan plugin --- Cargo.toml | 4 ++-- guest-js/index.ts | 19 ++++++++++++++++++- package.json | 4 ++-- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index df3edab..7f216b7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-plugin-bluclas" -version = "0.1.21" +version = "0.1.22" authors = [ "Rizky Denianto" ] description = "Program sederhana untuk interaksi dengan bluetooth classic" edition = "2024" @@ -28,7 +28,7 @@ ios = { level = "none" } tauri = { version = "2.11.5" } serde = "1.0" thiserror = "2" -serialport = "4.10.0" +serialport = "4.10.1" [build-dependencies] tauri-plugin = { version = "2.6.3", features = ["build"] } diff --git a/guest-js/index.ts b/guest-js/index.ts index c6d2397..9d2c5c8 100644 --- a/guest-js/index.ts +++ b/guest-js/index.ts @@ -1,4 +1,21 @@ -import { invoke } from "@tauri-apps/api/core"; +import { + checkPermissions as checkPermissions_, + invoke, + PermissionState, + requestPermissions as requestPermissions_, +} from "@tauri-apps/api/core"; + +export async function checkPermissions(): Promise { + return await checkPermissions_<{ bluetooth: PermissionState }>( + "bluclas", + ).then((e) => e.bluetooth); +} + +export async function requestPermissions(): Promise { + return await requestPermissions_<{ bluetooth: PermissionState }>( + "bluclas", + ).then((e) => e.bluetooth); +} export type SDaftarPerangkatBlueclasResponDaftarPerangkat = { nama: string; diff --git a/package.json b/package.json index 79a98d3..add9b25 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@segubi/tauri-plugin-bluclas-api", - "version": "0.1.21", + "version": "0.1.22", "author": "Rizky Denianto", "description": "Program sederhana untuk interaksi dengan bluetooth classic", "type": "module", @@ -26,7 +26,7 @@ }, "devDependencies": { "@rollup/plugin-typescript": "^12.3.0", - "rollup": "^4.63.1", + "rollup": "^4.63.2", "typescript": "^6.0.3", "tslib": "^2.8.1" } From 24c5d3e1f2e241fb7f7c3f19b02805de3c8e5ebf Mon Sep 17 00:00:00 2001 From: rizky_denianto Date: Sat, 12 Sep 2026 22:06:17 +0700 Subject: [PATCH 2/2] Mengubah urutan rilis agar cargo tidak komplen --- .gitea/workflows/penerbitan.yml | 24 ++++++++++++------------ Cargo.toml | 2 +- package.json | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.gitea/workflows/penerbitan.yml b/.gitea/workflows/penerbitan.yml index e8005d3..9985058 100644 --- a/.gitea/workflows/penerbitan.yml +++ b/.gitea/workflows/penerbitan.yml @@ -41,6 +41,18 @@ jobs: with: fetch-depth: 0 + - name: Unduh Rust + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: stable + rustflags: "-A warnings" + + - name: Penerbitan peti Cargo + run: | + cargo publish + env: + CARGO_REGISTRIES_GITEA_TOKEN: Bearer ${{ secrets.KUNCI_PENERBITAN }} + - name: Unduh pnpm uses: pnpm/setup@v2 with: @@ -53,15 +65,3 @@ jobs: npm config set -- '//${{ vars.ALAMAT_GITEA }}/api/packages/${{ needs.persiapan.outputs.organisasi }}/npm/:_authToken' "${{ secrets.KUNCI_PENERBITAN }}" npm publish rm -rf pnpm-lock.yaml .pnpm-store/ - - - name: Unduh Rust - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: - toolchain: stable - rustflags: "-A warnings" - - - name: Penerbitan peti Cargo - run: | - cargo publish - env: - CARGO_REGISTRIES_GITEA_TOKEN: Bearer ${{ secrets.KUNCI_PENERBITAN }} diff --git a/Cargo.toml b/Cargo.toml index 7f216b7..a55140c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-plugin-bluclas" -version = "0.1.22" +version = "0.1.23" authors = [ "Rizky Denianto" ] description = "Program sederhana untuk interaksi dengan bluetooth classic" edition = "2024" diff --git a/package.json b/package.json index add9b25..953b811 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@segubi/tauri-plugin-bluclas-api", - "version": "0.1.22", + "version": "0.1.23", "author": "Rizky Denianto", "description": "Program sederhana untuk interaksi dengan bluetooth classic", "type": "module",