mirror of
https://github.com/lbr77/SideImpactor.git
synced 2026-05-06 11:14:01 -04:00
refactor: migrate frontend to React + Tailwind, add Docker + tests
Replace the vanilla-TS innerHTML frontend with a type-checked React component tree (React 19 + Tailwind v4 + Vite). Frontend: - 14 components: Header, Stepper, LoginPage, LoginModal, SignPage, DropZone, DevicePicker, ProgressCard, SavedAccountsList, TrustModal, TwoFactorModal, Button, Field, Chip, Modal - lib/ extracts: storage (10 localStorage keys preserved), pair-record, account-session, log-parser, ids, use-log hook - flows/ encapsulate async pair/login/sign/install with dependency injection - Accounts page as main view with Add Account modal - Fullscreen progress overlay during sign/install - Account selector + device picker on Sign page - Security notice in login modal (server trust warning) - All addLog calls mirrored to console.log for devtools debugging Build: - bun run dev: submodule init + install + wasm dist + vite + wrangler - bun run setup: one-shot project bootstrap - Docker: multi-stage bun build → nginx on :3000 - build:wasm:dist copies pre-built src→dist (no Rust/Emscripten needed) - jszip/node-forge/fflate pre-bundled for CJS→ESM conversion Tests: - 163 vitest tests (happy-dom): all lib, components, App integration, WASM dist artifact checks, libcurl Apple connectivity, anisette init error handling Cleanup: - Delete yarn.lock (bun.lock canonical), expand .gitignore - Remove README.zh.md, rewrite README.md + AGENTS.md - Update libcurl.js submodule to f65d440 (CI build artifacts)
This commit is contained in:
@@ -1,34 +1,36 @@
|
||||
import { defineConfig } from "vite"
|
||||
import tailwindcss from "@tailwindcss/vite"
|
||||
import { dirname, resolve } from "node:path"
|
||||
import { fileURLToPath } from "node:url"
|
||||
import { defineConfig } from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
import tailwindcss from '@tailwindcss/vite';
|
||||
import { dirname, resolve } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
const frontendDir = dirname(fileURLToPath(import.meta.url))
|
||||
const repoRootDir = resolve(frontendDir, "..")
|
||||
const frontendDir = dirname(fileURLToPath(import.meta.url));
|
||||
const repoRootDir = resolve(frontendDir, '..');
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [tailwindcss()],
|
||||
plugins: [react(), tailwindcss()],
|
||||
server: {
|
||||
fs: {
|
||||
allow: [repoRootDir],
|
||||
},
|
||||
proxy: {
|
||||
"/wisp": { target: "ws://localhost:8787", ws: true },
|
||||
'/wisp': { target: 'ws://localhost:8787', ws: true },
|
||||
},
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
webmuxd: resolve(frontendDir, "src/webmuxd-browser.js"),
|
||||
webmuxd: resolve(frontendDir, 'src/webmuxd-browser.js'),
|
||||
},
|
||||
},
|
||||
optimizeDeps: {
|
||||
include: ['jszip', 'node-forge', 'fflate'],
|
||||
exclude: [
|
||||
"altsign.js",
|
||||
"@lbr77/anisette-js",
|
||||
"@lbr77/anisette-js/browser",
|
||||
"@lbr77/zsign-wasm-resigner-wrapper",
|
||||
"libcurl.js",
|
||||
"libcurl.js/bundled",
|
||||
'altsign.js',
|
||||
'@lbr77/anisette-js',
|
||||
'@lbr77/anisette-js/browser',
|
||||
'@lbr77/zsign-wasm-resigner-wrapper',
|
||||
'libcurl.js',
|
||||
'libcurl.js/bundled',
|
||||
],
|
||||
},
|
||||
build: {
|
||||
@@ -36,4 +38,4 @@ export default defineConfig({
|
||||
include: [/node_modules/],
|
||||
},
|
||||
},
|
||||
})
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user