Skip to content

Commit 48a8504

Browse files
committed
Update website: fetch xpubs
- Updated the deps - Remove useless justfile - Use nix run .#website
1 parent 7794d2e commit 48a8504

11 files changed

Lines changed: 1705 additions & 872 deletions

File tree

flake.nix

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,16 @@
1010
nixpkgs.url = "nixpkgs/nixos-unstable";
1111
};
1212

13-
outputs = { self, nixpkgs, flake-utils, rust-overlay }:
14-
flake-utils.lib.eachDefaultSystem (system:
15-
let
16-
overlays = [ rust-overlay.overlays.default ];
17-
pkgs = import nixpkgs { inherit system overlays; };
13+
outputs = {
14+
self,
15+
nixpkgs,
16+
flake-utils,
17+
rust-overlay,
18+
}:
19+
flake-utils.lib.eachDefaultSystem (
20+
system: let
21+
overlays = [rust-overlay.overlays.default];
22+
pkgs = import nixpkgs {inherit system overlays;};
1823
rust = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
1924
inputs = [
2025
rust
@@ -29,10 +34,8 @@
2934
pkgs.clang
3035
pkgs.corepack_20
3136
pkgs.nodejs_20
32-
pkgs.just
3337
];
34-
in
35-
{
38+
in {
3639
packages.default = pkgs.rustPlatform.buildRustPackage {
3740
name = "bhwi";
3841
src = ./.;
@@ -44,7 +47,6 @@
4447
nativeBuildInputs = inputs;
4548
};
4649

47-
4850
devShells.default = pkgs.mkShell {
4951
packages = inputs;
5052
shellHook = ''
@@ -54,6 +56,18 @@
5456
export CFLAGS_wasm32_unknown_unknown="-I ${pkgs.llvmPackages.libclang.lib}/lib/clang/21.1.8/include/"
5557
'';
5658
};
59+
60+
apps.website = {
61+
type = "app";
62+
program = toString (pkgs.writeShellScript "run-website" ''
63+
export PATH="${pkgs.lib.makeBinPath inputs}:$PATH"
64+
export LIBCLANG_PATH=${pkgs.libclang.lib}/lib/
65+
export CC_wasm32_unknown_unknown=${pkgs.llvmPackages.clang-unwrapped}/bin/clang
66+
export CFLAGS_wasm32_unknown_unknown="-I ${pkgs.llvmPackages.libclang.lib}/lib/clang/21.1.8/include/"
67+
wasm-pack build bhwi-wasm --out-dir ../website/pkg --target web
68+
cd website && npm install && npm run dev
69+
'');
70+
};
5771
}
5872
);
5973
}

justfile

Lines changed: 0 additions & 8 deletions
This file was deleted.

website/README.md

Lines changed: 7 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,15 @@
1-
# React + TypeScript + Vite
1+
# BHWI Website
22

3-
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
3+
Demo web application for [BHWI](../README.md) using WebAssembly.
44

5-
Currently, two official plugins are available:
5+
Supports connecting to Coldcard, Jade, and Ledger devices via WebHID/WebSerial.
66

7-
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
8-
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
7+
Requires a Chromium-based browser (Chrome, Edge, etc.).
98

10-
## Expanding the ESLint configuration
9+
## Running
1110

12-
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
11+
From the root of the repository:
1312

14-
- Configure the top-level `parserOptions` property like this:
15-
16-
```js
17-
export default tseslint.config({
18-
languageOptions: {
19-
// other options...
20-
parserOptions: {
21-
project: ['./tsconfig.node.json', './tsconfig.app.json'],
22-
tsconfigRootDir: import.meta.dirname,
23-
},
24-
},
25-
})
2613
```
27-
28-
- Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked`
29-
- Optionally add `...tseslint.configs.stylisticTypeChecked`
30-
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config:
31-
32-
```js
33-
// eslint.config.js
34-
import react from 'eslint-plugin-react'
35-
36-
export default tseslint.config({
37-
// Set the react version
38-
settings: { react: { version: '18.3' } },
39-
plugins: {
40-
// Add the react plugin
41-
react,
42-
},
43-
rules: {
44-
// other rules...
45-
// Enable its recommended rules
46-
...react.configs.recommended.rules,
47-
...react.configs['jsx-runtime'].rules,
48-
},
49-
})
14+
nix run .#website
5015
```

website/index.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />
5-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
65
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>Vite + React + TS</title>
6+
<title>BHWI</title>
87
</head>
98
<body>
109
<div id="root"></div>

0 commit comments

Comments
 (0)