Merge pull request #50 from librekeys/feat/gpui-migration

Migration of PicoForge Frontend to GPUI (Drop TAURI)
This commit is contained in:
Suyog Tandel
2026-02-11 23:52:02 +05:30
committed by GitHub
394 changed files with 11102 additions and 14565 deletions
+2
View File
@@ -0,0 +1,2 @@
[alias]
run-watch = "watch -c -x check -x run"
+1 -1
View File
@@ -1 +1 @@
use flake
use flake . --impure
+6 -1
View File
@@ -15,4 +15,9 @@ vite.config.ts.timestamp-*
# Nix
result
.direnv
.direnv
# misc
docs-gpui-components
src-svelte
gpui-component
+4226 -2041
View File
File diff suppressed because it is too large Load Diff
+12 -21
View File
@@ -1,30 +1,20 @@
[package]
name = "picoforge"
version = "0.3.1"
version = "0.4.0"
description = "An open source commissioning tool for Pico FIDO security keys. Developed with Rust, Tauri, and Svelte."
authors = ["Suyog Tandel", "PicoForge Contributers"]
license = "AGPL-3.0"
edition = "2024"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
# The `_lib` suffix may seem redundant but it is necessary
# to make the lib name unique and wouldn't conflict with the bin name.
# This seems to be only an issue on Windows, see https://github.com/rust-lang/cargo/issues/8519
name = "picoforge_lib"
crate-type = ["staticlib", "cdylib", "rlib"]
[build-dependencies]
tauri-build = { version = "2", features = [] }
[dependencies]
tauri = { version = "2", features = ["macos-private-api"] }
tauri-plugin-opener = "2"
tauri-plugin-shell = "2"
# tokio = { version = "1.49", features = ["full"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
log = "0.4" # Logging facade
log4rs = "1" # For logging to output (like stdout)
directories = "6" # For Applcation config/data dir handling
# For device management backend:
pcsc = "2" # Standard Smart Card API (connect to the key)
hex = "0.4" # For parsing "CAFE:4242" VID/PID strings
byteorder = "1.5" # Required for writing Big-Endian numbers (firmware requirement)
@@ -37,18 +27,19 @@ rand = "0.9"
bitflags = "2.10"
ring = "0.17" # For signing fido2 messages with pin token
log = "0.4" # Logging facade
log4rs = "1" # For logging to output (like stdout)
# dirs = "6"
directories = "6" # For Applcation config/data dir handling
# For Application UI:
gpui = { version = "0.2.2", features = [] }
gpui-component = "0.5.1"
rust-embed = "8.11.0"
[profile.dev]
incremental = true # Compile your binary in smaller steps.
codegen-units = 256
opt-level = 1
[profile.release]
codegen-units = 1 # Allows LLVM to perform better optimization.
lto = true # Enables link-time-optimizations however is not stable.
opt-level = 3 # Prioritizes speed. Use `z` if you prefer small binary size.
# panic = "abort" # Higher performance by disabling panic handlers.
panic = "abort" # Higher performance by disabling panic handlers.
strip = true # Ensures debug symbols are removed.
+1 -1
View File
@@ -2,7 +2,7 @@
# PicoForge
<img src="static/in.suyogtandel.picoforge.svg" width="512" height="512" alt="PicoForge Logo">
<img src="static/appIcons/in.suyogtandel.picoforge.svg" width="512" height="512" alt="PicoForge Logo">
**An open source commissioning tool for Pico FIDO security keys**
-52
View File
@@ -1,52 +0,0 @@
{
"$schema": "https://biomejs.dev/schemas/2.3.11/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"files": {
"ignoreUnknown": false,
"includes": [
"src/**",
"!src/app.html",
"!src/app.css",
"!src/lib/components/ui/**",
"!src/lib/utils.ts",
"!src/lib/hooks/is-mobile.svelte.ts"
]
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 140
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"javascript": {
"formatter": {
"lineWidth": 120,
"quoteStyle": "double",
"semicolons": "always",
"trailingCommas": "es5"
}
},
"html": {
"formatter": {
"lineWidth": 140
}
},
"assist": {
"enabled": true,
"actions": {
"source": {
"organizeImports": "on"
}
}
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"$schema": "https://shadcn-svelte.com/schema.json",
"tailwind": {
"css": "src/app.css",
"baseColor": "zinc"
},
"aliases": {
"components": "$lib/components",
"utils": "$lib/utils",
"ui": "$lib/components/ui",
"hooks": "$lib/hooks",
"lib": "$lib"
},
"typescript": true,
"registry": "https://shadcn-svelte.com/registry"
}
-21
View File
@@ -1,21 +0,0 @@
{
"unstable": ["fmt-component"],
"fmt": {
"useTabs": false,
"indentWidth": 2,
"lineWidth": 140,
"include": ["src"],
"exclude": [
"src/app.html",
"src/app.css",
"src/lib/components/ui",
"src/lib/utils.ts",
"src/lib/hooks/is-mobile.svelte.ts"
]
}
}
Generated
-1138
View File
File diff suppressed because it is too large Load Diff
Generated
+18 -18
View File
@@ -6,11 +6,11 @@
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1769064677,
"narHash": "sha256-Upa108vGOlaOBGQTmmLEKuWekBm519u42A/oYSjTs+4=",
"lastModified": 1770188896,
"narHash": "sha256-ZBpEh6aTvdoZvIM8sojnr43FPyegq/sjUkNWtF4kDO8=",
"owner": "nix-community",
"repo": "fenix",
"rev": "439e81e0b40781e16c444ca1c7fcd1cf8c5c406c",
"rev": "6dbe5750c68a55e7cb3f8b62883c4dbfeecf14d5",
"type": "github"
},
"original": {
@@ -23,11 +23,11 @@
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1768135262,
"narHash": "sha256-PVvu7OqHBGWN16zSi6tEmPwwHQ4rLPU9Plvs8/1TUBY=",
"lastModified": 1769996383,
"narHash": "sha256-AnYjnFWgS49RlqX7LrC4uA+sCCDBj0Ry/WOJ5XWAsa0=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "80daad04eddbbf5a4d883996a73f3f542fa437ac",
"rev": "57928607ea566b5db3ad13af0e57e921e6b12381",
"type": "github"
},
"original": {
@@ -38,11 +38,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1768886240,
"narHash": "sha256-C2TjvwYZ2VDxYWeqvvJ5XPPp6U7H66zeJlRaErJKoEM=",
"lastModified": 1770115704,
"narHash": "sha256-KHFT9UWOF2yRPlAnSXQJh6uVcgNcWlFqqiAZ7OVlHNc=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "80e4adbcf8992d3fd27ad4964fbb84907f9478b0",
"rev": "e6eae2ee2110f3d31110d5c222cd395303343b08",
"type": "github"
},
"original": {
@@ -54,11 +54,11 @@
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1765674936,
"narHash": "sha256-k00uTP4JNfmejrCLJOwdObYC9jHRrr/5M/a/8L2EIdo=",
"lastModified": 1769909678,
"narHash": "sha256-cBEymOf4/o3FD5AZnzC3J9hLbiZ+QDT/KDuyHXVJOpM=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "2075416fcb47225d9b68ac469a5c4801a9c4dd85",
"rev": "72716169fe93074c333e8d0173151350670b824c",
"type": "github"
},
"original": {
@@ -69,11 +69,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1769018530,
"narHash": "sha256-MJ27Cy2NtBEV5tsK+YraYr2g851f3Fl1LpNHDzDX15c=",
"lastModified": 1770115704,
"narHash": "sha256-KHFT9UWOF2yRPlAnSXQJh6uVcgNcWlFqqiAZ7OVlHNc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "88d3861acdd3d2f0e361767018218e51810df8a1",
"rev": "e6eae2ee2110f3d31110d5c222cd395303343b08",
"type": "github"
},
"original": {
@@ -93,11 +93,11 @@
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1768996281,
"narHash": "sha256-s+TolkG0f98fR6RtBEmymBb8RHmZ04U3SL8cjoqog2k=",
"lastModified": 1770092556,
"narHash": "sha256-DcUKN1nzz7LhyZGJMhSBhY5zrl8/GjJJ9SNqqTd77OQ=",
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "2d124215693f13dcf6ad097a02acdd473c80e447",
"rev": "a84d92ff213e30fb00d7b812e07c4f67e99dcd29",
"type": "github"
},
"original": {
-2866
View File
File diff suppressed because it is too large Load Diff
-46
View File
@@ -1,46 +0,0 @@
{
"name": "picoforge",
"version": "0.3.1",
"description": "",
"type": "module",
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"tauri": "tauri",
"fmt": "biome format --write",
"fmt:check": "biome format",
"lint": "biome lint",
"lint:fix": "biome lint --write"
},
"license": "MIT",
"dependencies": {
"@tailwindcss/vite": "^4.1.18",
"@tauri-apps/api": "^2",
"@tauri-apps/plugin-opener": "^2",
"@tauri-apps/plugin-shell": "~2.3.4",
"tailwindcss": "^4.1.18"
},
"devDependencies": {
"@biomejs/biome": "^2.3.12",
"@internationalized/date": "^3.10.1",
"@lucide/svelte": "^0.563.1",
"@sveltejs/adapter-static": "^3.0.6",
"@sveltejs/kit": "^2.50.1",
"@sveltejs/vite-plugin-svelte": "^6.2.4",
"@tauri-apps/cli": "^2",
"bits-ui": "^2.15.4",
"clsx": "^2.1.1",
"svelte": "^5.48.2",
"svelte-check": "^4.0.0",
"tailwind-merge": "^3.4.0",
"tailwind-variants": "^3.2.2",
"terser": "^5.46.0",
"tw-animate-css": "^1.4.0",
"typescript": "~5.9.3",
"vaul-svelte": "^1.0.0-next.7",
"vite": "^7.3.1"
}
}
+43 -44
View File
@@ -1,81 +1,80 @@
{
lib,
stdenv,
rustPlatform,
buildNpmPackage,
fetchFromGitHub,
makeDesktopItem,
pkg-config,
cargo-tauri,
wrapGAppsHook3,
copyDesktopItems,
makeWrapper,
glib,
gtk3,
openssl,
hidapi,
pcsclite,
udev,
webkitgtk_4_1,
alsa-lib,
libxkbcommon,
wayland,
libGL,
vulkan-loader,
libx11,
libxcb,
withGLES ? false,
}:
assert withGLES -> stdenv.hostPlatform.isLinux;
rustPlatform.buildRustPackage (finalAttrs: {
pname = "picoforge";
version = "0.3.1";
version = "0.3.1-unstable-2026-02-08";
src = fetchFromGitHub {
owner = "librekeys";
repo = "picoforge";
rev = "v${finalAttrs.version}";
hash = "sha256-v3N/E80mS8KZafWJ5T6BD3+O9LL+iwNXFEThbo4Lf0Y=";
rev = "430aec1f3429ee8b89470f78d6db8c22c5de7db4";
hash = "sha256-BWLLmINoKC+nIuY8KWfzhOnYtuo2KrbHd2jdappPyuE=";
};
cargoRoot = "src-tauri";
buildAndTestSubdir = finalAttrs.cargoRoot;
cargoHash = "sha256-DB54egPebUniP/yjEZc+/AY9vOChJRBA+tqnbISmEgg=";
postPatch = ''
sed -i src-tauri/tauri.conf.json -e '/beforeBuildCommand/d'
'';
cargoHash = "sha256-be0ycwwDxlBaKxQsTGidZC0loFh91HXMpr0jMHfbAd4=";
nativeBuildInputs = [
pkg-config
cargo-tauri.hook
wrapGAppsHook3
copyDesktopItems
]
++ lib.optionals stdenv.hostPlatform.isLinux [
makeWrapper
];
gpu-lib = if withGLES then libGL else vulkan-loader;
buildInputs = [
glib
gtk3
openssl
hidapi
pcsclite
udev
webkitgtk_4_1
]
++ lib.optionals stdenv.hostPlatform.isLinux [
alsa-lib
libxkbcommon
wayland
finalAttrs.gpu-lib
libx11
libxcb
];
frontendDist = buildNpmPackage {
name = "${finalAttrs.pname}-${finalAttrs.version}-frontend-dist";
inherit (finalAttrs) src;
npmDepsHash = "sha256-yCs/Fvtf0m5eW/m+Revzn3q1P7wwkwinUBHLOcV06/M=";
installPhase = ''
runHook preInstall
mkdir -p $out
cp -r build/* $out
runHook postInstall
'';
};
preBuild = ''
cp -r ${finalAttrs.frontendDist} build
postInstall = ''
install -Dm644 ${finalAttrs.src}/static/appIcons/in.suyogtandel.picoforge.svg $out/share/icons/hicolor/scalable/apps/picoforge.svg
'';
postInstall = ''
install -Dm644 ${finalAttrs.src}/static/in.suyogtandel.picoforge.svg $out/share/icons/hicolor/scalable/apps/picoforge.svg
postFixup = lib.optionalString stdenv.hostPlatform.isLinux ''
wrapProgram $out/bin/picoforge --prefix LD_LIBRARY_PATH : "${
lib.makeLibraryPath [
wayland
libxkbcommon
finalAttrs.gpu-lib
libx11
libxcb
]
}"
'';
desktopItems = [
+1 -1
View File
@@ -1,4 +1,4 @@
edition = "2024"
hard_tabs = true
hard_tabs = false
tab_spaces = 4
max_width = 100
+30 -37
View File
@@ -1,23 +1,25 @@
{ pkgs ? import <nixpkgs> { } }:
{
pkgs ? import <nixpkgs> { },
}:
let
libraries = with pkgs; [
at-spi2-atk
atkmm
cairo
gdk-pixbuf
glib
gtk3
harfbuzz
librsvg
libsoup_3
pango
webkitgtk_4_1
libcanberra-gtk3
pcsclite
hidapi
mesa
mesa
udev
libxkbcommon
vulkan-loader
wayland
libglvnd
wayland-protocols
libunwind
libdrm
xorg.libX11
xorg.libXcursor
xorg.libXi
xorg.libXrandr
xorg.libxcb
];
packages = with pkgs; [
@@ -28,29 +30,19 @@ let
openssl_3
librsvg
git
# Development tools
rustc
clippy
rustfmt
rust-analyzer
rustPlatform.rustLibSrc
mold
cargo
deno
nodejs_22
# Tauri 2 dependencies
at-spi2-atk
atkmm
cairo
gdk-pixbuf
glib
gtk3
harfbuzz
librsvg
libsoup_3
pango
webkitgtk_4_1
libcanberra-gtk3
packagekit
# GPUI
libxkbcommon
# Hardware
pcsclite
hidapi
@@ -60,17 +52,18 @@ in
pkgs.mkShell {
buildInputs = packages;
RUST_SRC_PATH = "${pkgs.rustPlatform.rustLibSrc}";
shellHook = ''
export LD_LIBRARY_PATH=${pkgs.lib.makeLibraryPath libraries}:$LD_LIBRARY_PATH
export GTK_PATH=${pkgs.libcanberra-gtk3}/lib/gtk-3.0:${pkgs.packagekit}/lib/gtk-3.0:$GTK_PATH
export XDG_DATA_DIRS=$GSETTINGS_SCHEMAS_PATH:$XDG_DATA_DIRS
export RUSTFLAGS="-C link-arg=-fuse-ld=mold"
# Try to uncomment the following lines if you encounter EGL_BAD_PARAMETER errors:
# export LIBGL_ALWAYS_SOFTWARE=1
# export WEBKIT_DISABLE_COMPOSITING_MODE=1
echo "Nix development environment loaded!"
echo "Available tools: rustc, cargo, deno, node, tauri"
echo "Available tools: rustc, cargo"
'';
}
-7
View File
@@ -1,7 +0,0 @@
# Generated by Cargo
# will have compiled files and executables
/target/
# Generated by Tauri
# will have schema files for capabilities auto-completion
/gen/schemas
-3
View File
@@ -1,3 +0,0 @@
fn main() {
tauri_build::build()
}
-18
View File
@@ -1,18 +0,0 @@
{
"$schema": "../gen/schemas/desktop-schema.json",
"identifier": "default",
"description": "Capability for the main window",
"windows": [
"main"
],
"permissions": [
"core:default",
"opener:default",
"core:window:allow-minimize",
"core:window:allow-maximize",
"core:window:allow-close",
"core:window:allow-start-dragging",
"core:window:allow-toggle-maximize",
"shell:default"
]
}
@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
<background android:drawable="@color/ic_launcher_background"/>
</adaptive-icon>

Some files were not shown because too many files have changed in this diff Show More