Commit e7ee2e40 by liimin

添加登录鉴权

1 parent 3336d7e0
node_modules
dist
.git
.gitignore
*.log
# 不要把本地演示账号拷进镜像:容器内用 volume 或 BOOTSTRAP_USER 初始化
packages/server/data
.env
.env.*
coverage
docs
.DS_Store
Thumbs.db
...@@ -13,3 +13,15 @@ VITE_AMAP_SECURITY_CODE= ...@@ -13,3 +13,15 @@ VITE_AMAP_SECURITY_CODE=
# 高德加载失败时的兜底排查提示开关(true 时控制台输出详细诊断信息) # 高德加载失败时的兜底排查提示开关(true 时控制台输出详细诊断信息)
VITE_AMAP_DEBUG=true VITE_AMAP_DEBUG=true
# ============================================================================
# 登录后台服务(packages/server)配置
# ----------------------------------------------------------------------------
# AUTH_SECRET:JWT 签发密钥,生产环境务必设为强随机值(如 openssl rand -hex 32)
# 未设置时服务会回退到不安全的开发默认密钥并告警
# SERVER_PORT:登录服务监听端口,需与 vite.config.ts 中 server.proxy 的 target 一致
#
# 复制本文件为 .env.local 后填写(.env.local 已在 .gitignore 中,不会入库)
# ============================================================================
AUTH_SECRET=
SERVER_PORT=8787
...@@ -18,3 +18,11 @@ Thumbs.db ...@@ -18,3 +18,11 @@ Thumbs.db
.vscode/* .vscode/*
!.vscode/extensions.json !.vscode/extensions.json
coverage/ coverage/
# 本地环境变量(含 AUTH_SECRET 等密钥),不入库;保留 .env.example
.env
.env.local
.env.*.local
# 登录服务运行数据(账号哈希),不入库;用 pnpm --filter @hm/server gen:account 生成
packages/server/data/accounts.json
# 2026-10-26 工作记录
## heatmap 登录功能(前端登录页 + 后端鉴权)
- 架构决策(超人拍板):Hono + JWT(jose) + react-router `/login` 路由。
- 落地:`packages/server`(`@hm/server`,Hono 服务)提供 `/api/login|me|logout|health`;
前端 `useAuthStore`(zustand+persist) + `LoginPage` + `RequireAuth`;`HeaderBar` 加用户菜单/退出;
`main.tsx` 用 `BrowserRouter` 包 `/login` 与受保护路由;`App.tsx` 去掉重复 `ConfigProvider` 包裹(提到 main)。
- 生产部署做成**单进程同源托管**:server 在 `app.get('*')` 兜底同源托管 `dist/` 静态 + SPA fallback,
`pnpm start` = build + 起单进程(无需 Nginx/双进程/CORS)。开发 `pnpm dev:all`(concurrently 双进程 + vite proxy `/api`)。
- 账号:`packages/server/data/accounts.json`(gitignore),演示 `admin/admin123`(仅哈希)。
账号管理 CLI(2026-10-26 新增,纯 Node 内置、已用 `node` 直接跑验证通过):
- `add:account [user]` —— 交互输密码不回显,同名自动更新(即改密);写文件用 tmp+rename 原子写。
- `list:accounts` / `remove:account <user>`。
旧 `gen:account <user> <pwd>` 保留但密码明文进命令行历史,仅兼容、不推荐生产。
AUTH_SECRET 生产必须设(jose HS256,缺省 dev 警告)。
## 待办 / 风险
- 本会话沙箱安全策略拦 `wmic.exe`(Program Blacklist),`pnpm install` 跑不成 → 新增依赖未装,
未能在此启动验证。需超人本机 `pnpm install`(首次重建 node_modules 输 y;勿用 `--confirm`,该版本不支持)。
- 目录结构不够地道:`packages/server` 把"应用"塞进"库"目录(`packages/*` 本意放 ui/map-overlay 库)。
超人质疑,倾向未来挪 `apps/server`。待确认是否重构。
## 修复:退出登录白屏(2026-10-26 下午)
- 现象:点「退出登录」后白屏,必须手动刷新才显示 /login。
- 根因:退出时只清 token,依赖 `RequireAuth` 被动 `<Navigate to="/login">` 跳转;该 SPA 内被动重定向在
超人运行环境偶发不生效(刷新是整页重载、路由从头匹配 /login 才正常)。且全应用无错误边界,任何卸载期
异常(如地图 dispose)会直接白屏。
- 修复:① `HeaderBar` 退出后**主动** `navigate('/login', { replace: true })`(不依赖守卫被动跳转);
② 新增 `src/ErrorBoundary.tsx` 包住 `<Routes>`,渲染/卸载异常显示可读兜底而非白屏。
③ `tsc --noEmit` 通过。
- 注:除 `HeaderBar` 用 `user?.username`(可选链安全)外,无任何组件非空读 `user`,排除"读 null 崩"。
## 脚本调整:pnpm dev 直接跑全栈(2026-10-26 下午)
- 既然主界面必须登录才能进,纯前端 `pnpm dev` 单独跑没意义(/api 必 ECONNREFUSED)。
- `dev` 改为 `concurrently "vite" "cd packages/server && pnpm dev"`(前端+后端一键);
`dev:web` = 仅前端(后端已在跑/只改登录页时用);`dev:all` 改为 `pnpm dev` 别名。
- README 启动段同步更新。
## 修复:退出时白屏真凶 = HeatLayer.destroy 调了不存在的 AMap.HeatMap.destroy(2026-10-26 下午)
- 现象:错误边界兜底显示「页面出错了 / this.heat?.destroy is not a function」。
- 根因:`src/features/heatmap/map/HeatLayer.ts:285` `this.heat?.destroy()` —— amap.d.ts:109 误声明
`HeatMap.destroy()`,但 AMap JS API 2.0 运行时无此方法(官方移除方式是 `setMap(null)`,
第 284 行已做)。该 throw 发生在 MapStage 卸载清理最前(heatRef 先于 mapRef 销毁),
导致后续 map.destroy 等清理中断、整树卸载崩。
- 修复:删掉 `this.heat?.destroy()` 一行,仅保留 `setMap(null)` + 置空。`tsc --noEmit` 通过。
- 其余图层 `destroy()` 来自自研 `@hm/map-overlay`(overlay.ts:245 真实实现)与 `AMap.Map.destroy()`
(运行时存在),不受影响。
- 教训:AMap 类型声明与运行时多有出入,凡 `.destroy()` 类调用需按运行时核实。
## pnpm start 形态(澄清)
- `pnpm start` = `pnpm build`(vite build→dist/) + `pnpm --filter @hm/server start`(单 Node 进程)。
该进程 **同源托管 dist/ 静态 + 处理 /api/**(index.ts `app.get('*')` 兜底 + `/api/*` 路由),
单进程、无 Nginx/双进程/CORS,端口 8787。生产即 `pnpm start` 一条命令全栈。
- 与开发 `pnpm dev`(双进程 vite+server + proxy)形态不同,但"前后端都起"等价。
## 数据源收敛为「只认导入」,去掉假空态(2026-10-26 下午)
- 现象:顶栏「清除导入数据,回到空态」在本地实际载入了一份默认数据(`public/data/incidents.json` 1.59MB)。
- 根因:`clearImportedBundle()` 只删 IndexedDB(`hm-heatmap-import` 库的 incidents/detail 两条),
但 `useBootstrap` 原有第二级回退 `setDataOrigin('sample')` → 加载 `public/data/*`,
于是清完又载回示例产物,是**假空态**。真正 EMPTY 只在两级都缺时触发。
- 修复(超人定方向:改行为·真回空态):
1. `useBootstrap.ts`:无导入数据 → 直接 `setStatus('empty')`,删除 sample 加载回退;
catch 仅剩「导入数据存在但装载失败」→ `error`(不伪装空态)。
2. `useHeatmapStore.ts`:`dataOrigin` 类型 `'sample'|'imported'` → `'empty'|'imported'`,初值 `'empty'`。
3. `HeaderBar.tsx`:标签 `样本`→`未导入`;sourceTip 删除「本地 data:build 产物(public/data)」死分支。
4. `ImportControl.tsx`:`restoreSample()` 改名 `clearImport()`(名实相符),仍 = clear + 整页 reload。
`tsc --noEmit` 通过。
- 残留说明:`public/data/` 已被 .gitignore(第 6 行)、不入库,但物理存在时 `vite build` 仍会拷进 dist,
生产可直连 `/data/incidents.json`。若不需要本地演示数据,build 前删 `public/data/`。
- `detailLoader.ts` 的 `source:'sample'|'imported'` 与 `loadData.ts` 的 loadMeta/loadIncidents/loadDetail 保留,
作为「未来接后端接口」的既定接缝,当前运行时不触发 sample 分支。
# 单进程同源托管:前端静态(dist/) + 登录 API(/api) 同容器同端口(8787)。
# 账号数据挂命名 volume,重建容器不丢。
# ---- 构建前端 ----
FROM node:22-alpine AS builder
WORKDIR /app
RUN corepack enable
COPY . .
RUN pnpm install --frozen-lockfile \
&& pnpm build
# ---- 运行 ----
FROM node:22-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production
ENV SERVER_PORT=8787
RUN corepack enable
# 只拷运行所需源码与前端产物,重新解析依赖(含 tsx 以运行 .ts)
COPY pnpm-lock.yaml package.json pnpm-workspace.yaml ./
COPY packages ./packages
COPY src ./src
COPY public ./public
COPY index.html vite.config.ts tsconfig.json tsconfig.node.json ./
COPY --from=builder /app/dist ./dist
RUN pnpm install --frozen-lockfile
# 账号目录挂为 volume(见 docker-compose.yml),避免写入镜像层
VOLUME ["/app/packages/server/data"]
EXPOSE 8787
CMD ["pnpm", "--filter", "@hm/server", "start"]
...@@ -19,10 +19,11 @@ ...@@ -19,10 +19,11 @@
```bash ```bash
pnpm install # 安装依赖 pnpm install # 安装依赖
pnpm data:build # 生成模拟样本 + 离线预处理(产出 public/data/*) pnpm data:build # 生成模拟样本 + 离线预处理(产出 public/data/*)
pnpm dev # 启动 dev server,端口 5174 pnpm dev # 同时起前端(5174)与登录服务(8787),打开即需登录
``` ```
打开 `http://localhost:5174`。 打开 `http://localhost:5174` 会先跳到 `/login`。
> 仅改前端、且后端已在跑,可用 `pnpm dev:web` 只起前端。
### 高德 Key 配置(硬阻塞项) ### 高德 Key 配置(硬阻塞项)
...@@ -78,3 +79,103 @@ src/ ...@@ -78,3 +79,103 @@ src/
- **实测事实**:4W 条数据下,z17 时平均 1.4 点/桶——高缩放下聚合会退化为「1」,因此 `ClusterLayer` 在桶均点数 ≤ 2 时自动切到散点模式(只画小圆点、不写数字)。 - **实测事实**:4W 条数据下,z17 时平均 1.4 点/桶——高缩放下聚合会退化为「1」,因此 `ClusterLayer` 在桶均点数 ≤ 2 时自动切到散点模式(只画小圆点、不写数字)。
详细技术决策见 `docs/技术方案与决策记录.md`。 详细技术决策见 `docs/技术方案与决策记录.md`。
## 登录与后台服务
系统需要一个最小可用的登录鉴权:前端登录页 + 独立 Node 后台服务(仅负责签发 / 校验登录态)。
### 架构
- 后端:`packages/server`(`@hm/server`),Hono + jose,监听 `SERVER_PORT`(默认 8787)。
与前端数据 API 共用 `/api` 前缀;dev 下由 `vite.config.ts` 的 `server.proxy` 把 `/api`
透传到后端,前端无感、无 CORS。
- 前端:`react-router-dom` 的 `/login` 路由 + `RequireAuth` 路由守卫;登录态(JWT)存
zustand 并经 `localStorage` 持久化,启动调 `/api/me` 续期。
### 接口
| 方法 | 路径 | 说明 |
|---|---|---|
| POST | `/api/login` | body `{username, password}`,成功返回 `{token, user}` |
| GET | `/api/me` | 带 `Authorization: Bearer <token>`,返回当前用户 |
| POST | `/api/logout`| 无状态 JWT,前端丢弃 token 即登出 |
| GET | `/api/health`| 健康检查 |
### 本地账号
账号与密码哈希存 `packages/server/data/accounts.json`(已被 .gitignore 忽略,不入库)。
**添加 / 更新账号**(推荐,密码交互输入不回显,不进 shell 历史):
```bash
pnpm --filter @hm/server add:account # 交互询问用户名 + 密码
pnpm --filter @hm/server add:account alice # 指定用户名,密码仍交互输入
```
同名账号会自动更新密码(即"改密码")。其他运维命令:
```bash
pnpm --filter @hm/server list:accounts # 列出所有账号(不显示哈希)
pnpm --filter @hm/server remove:account alice # 删除账号
```
> 旧命令 `gen:account <用户名> <密码>` 仍保留可用,但密码以明文参数传入(会进 shell 历史 / 进程列表可见),不建议生产使用。
仓库内置一个演示账号 `admin / admin123`(仅哈希落盘),**上线前务必替换**。
### 启动
开发(前端热更新 + 登录服务,两个进程;vite 反向代理 `/api` 同源,无 CORS):
```bash
pnpm install
pnpm dev # 同时起前端(5174)与登录服务(8787),默认一条命令跑全栈
# 或分别起:pnpm dev:web(仅前端) 与 pnpm server(仅后端)
# dev:all 是 pnpm dev 的别名,保留以防肌肉记忆
```
打开 `http://localhost:5174` 会先跳到 `/login`。
生产(一键:先 build 前端,再由登录服务**单进程同源**托管静态 + `/api`,无需 Nginx):
```bash
pnpm install
pnpm start # = pnpm build && pnpm --filter @hm/server start
```
打开 `http://localhost:8787` 即全栈单进程(前端静态与登录 API 同端口同源)。改端口用
`SERVER_PORT` 环境变量;多实例 / 独立伸缩才需要 Nginx 反代(见下)。
### 生产部署提醒
**首选单进程方案**:`pnpm start` 已让登录服务同源托管前端静态产物与 `/api`(同一 Node 进程、
同端口、内置 SPA fallback)。这种形态下**无需 Nginx、无需两个进程、无 CORS**,最省事;唯一硬要求是:
1. **`AUTH_SECRET` 必须设为强随机值**(如 `openssl rand -hex 32`),否则 JWT 可被伪造。
2. **上线后加账号**:在运行服务的机器上 `pnpm --filter @hm/server add:account <用户名>`(密码交互输入不回显)即可。**无需重启服务**——后端每次登录都从 `accounts.json` 实时读取,不缓存到内存。Docker 部署务必把 `packages/server/data/` 挂为持久化 volume,否则容器重建会丢失新增账号。
只有在「前端上 CDN / 后端独立容器 / 多实例负载均衡」这类规模化场景才需要额外反代:
1. **同源反代**:Nginx 把 `/api` 转发到 Node 进程(8787),静态资源走 CDN 或同机 Nginx。
2. 若仍由 Node 托管静态,SPA fallback 已内置,刷新 `/login` 不会 404;若静态走 Nginx,需自行
配置 `try_files $uri /index.html`。
### Docker 部署
仓库根提供 `Dockerfile` 与 `docker-compose.yml`(单进程同源托管,前端静态 + `/api` 同容器)。
账号目录 `/app/packages/server/data` 挂命名 volume `server-data`,**容器重建不丢账号**。
首次启动初始化管理员(二选一):
- 推荐:先在宿主机生成账号文件再挂进 volume —— 本机 `pnpm --filter @hm/server add:account admin`
生成 `packages/server/data/accounts.json`(已被 .dockerignore 排除出镜像),compose 已把它挂为 volume;
- 或:用环境变量一次性 bootstrap(仅初始化,生效建议改密或移除 env):
`AUTH_SECRET=$(openssl rand -hex 32) BOOTSTRAP_USER=admin BOOTSTRAP_PASSWORD=<强密码> docker compose up -d`
上线后加账号(容器内实时读 `accounts.json`,**无需重启**):
```bash
docker compose exec heatmap pnpm --filter @hm/server add:account 新同事名
```
`AUTH_SECRET` 必须强随机且通过 env 注入,**切勿写进镜像**(`.dockerignore` 已排除 `.env`)。
services:
heatmap:
build: .
ports:
- "8787:8787"
environment:
SERVER_PORT: "8787"
# 务必强随机:openssl rand -hex 32
AUTH_SECRET: "${AUTH_SECRET}"
# 首次初始化(可选):容器无账号文件时建默认账号;生效后可删 env 或用 add:account 改密
BOOTSTRAP_USER: "${BOOTSTRAP_USER:-}"
BOOTSTRAP_PASSWORD: "${BOOTSTRAP_PASSWORD:-}"
volumes:
# 账号持久化:容器重建/更新不丢新增账号
- server-data:/app/packages/server/data
restart: unless-stopped
volumes:
server-data:
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
"node": "^22.22.2 || ^24.15.0 || >=26.0.0" "node": "^22.22.2 || ^24.15.0 || >=26.0.0"
}, },
"scripts": { "scripts": {
"dev": "vite", "dev": "concurrently -n web,api -c blue,green \"vite\" \"cd packages/server && pnpm dev\"",
"dev:web": "vite",
"build": "tsc --noEmit && vite build", "build": "tsc --noEmit && vite build",
"preview": "vite preview", "preview": "vite preview",
"typecheck": "tsc --noEmit", "typecheck": "tsc --noEmit",
...@@ -21,6 +22,9 @@ ...@@ -21,6 +22,9 @@
"data:gen": "node scripts/generate-sample.mjs", "data:gen": "node scripts/generate-sample.mjs",
"data:prep": "node scripts/preprocess.mjs", "data:prep": "node scripts/preprocess.mjs",
"data:build": "node scripts/data-build-noop.mjs", "data:build": "node scripts/data-build-noop.mjs",
"server": "pnpm --filter @hm/server dev",
"start": "pnpm build && pnpm --filter @hm/server start",
"dev:all": "pnpm dev",
"prepare": "husky" "prepare": "husky"
}, },
"dependencies": { "dependencies": {
...@@ -43,6 +47,7 @@ ...@@ -43,6 +47,7 @@
"@types/react-dom": "^19.0.0", "@types/react-dom": "^19.0.0",
"@typescript-eslint/parser": "^8", "@typescript-eslint/parser": "^8",
"@vitejs/plugin-react": "^4.3.4", "@vitejs/plugin-react": "^4.3.4",
"concurrently": "^9.1.0",
"eslint": "^9", "eslint": "^9",
"eslint-config-prettier": "^9", "eslint-config-prettier": "^9",
"eslint-plugin-react-hooks": "^5", "eslint-plugin-react-hooks": "^5",
......
{
"name": "@hm/server",
"version": "0.1.0",
"private": true,
"type": "module",
"description": "风险热力图 · 登录后台服务(Hono + jose,仅负责鉴权)",
"scripts": {
"dev": "tsx src/index.ts",
"start": "tsx src/index.ts",
"typecheck": "tsc --noEmit",
"gen:account": "tsx scripts/gen-account.mjs",
"add:account": "tsx scripts/add-account.mjs",
"list:accounts": "tsx scripts/list-accounts.mjs",
"remove:account": "tsx scripts/remove-account.mjs"
},
"dependencies": {
"@hono/node-server": "^1.13.0",
"dotenv": "^16.4.0",
"hono": "^4.6.0",
"jose": "^5.9.0"
},
"devDependencies": {
"@types/node": "^22.0.0",
"tsx": "^4.19.0"
}
}
// 交互式添加/更新账号。密码读入不回显,避免明文进 shell 历史 / 进程列表。
// 用法: pnpm --filter @hm/server add:account [用户名]
// 省略用户名则交互询问;密码一律交互输入(不回显)。
import { scryptSync, randomBytes } from 'node:crypto';
import { existsSync, readFileSync, writeFileSync, renameSync, mkdirSync } from 'node:fs';
import { fileURLToPath } from 'node:url';
import path from 'node:path';
import { createInterface } from 'node:readline/promises';
import { stdin, stdout } from 'node:process';
const here = path.dirname(fileURLToPath(import.meta.url));
const ACCOUNTS_PATH = path.resolve(here, '../data/accounts.json');
/** 读一行(非 TTY 时按行读,便于管道测试) */
async function ask(prompt) {
const rl = createInterface({ input: stdin, output: stdout });
const ans = (await rl.question(prompt)).trim();
rl.close();
return ans;
}
/** 不回显读密码(TTY 走 raw mode;管道/非 TTY 降级为读一行) */
function askHidden(prompt) {
return new Promise((resolve) => {
if (!stdin.isTTY) {
const rl = createInterface({ input: stdin });
rl.once('line', (line) => {
rl.close();
stdout.write('\n');
resolve(line);
});
stdout.write(prompt);
return;
}
stdout.write(prompt);
stdin.setRawMode(true);
stdin.resume();
let buf = '';
const onData = (d) => {
const s = d.toString();
if (s === '\r' || s === '\n') {
stdin.setRawMode(false);
stdin.pause();
stdin.removeListener('data', onData);
stdout.write('\n');
resolve(buf);
} else if (s === '\u0003') {
// Ctrl-C
stdout.write('\n');
process.exit(1);
} else if (s === '\u007f' || s === '\b') {
buf = buf.slice(0, -1);
} else if (s >= ' ') {
buf += s;
}
};
stdin.on('data', onData);
});
}
const argUser = process.argv[2];
const username = argUser ?? (await ask('用户名: '));
if (!username) {
console.error('用户名不能为空');
process.exit(1);
}
const password = await askHidden('密码: ');
if (!password) {
console.error('密码不能为空');
process.exit(1);
}
mkdirSync(path.dirname(ACCOUNTS_PATH), { recursive: true });
const accounts = existsSync(ACCOUNTS_PATH)
? JSON.parse(readFileSync(ACCOUNTS_PATH, 'utf-8'))
: [];
const salt = randomBytes(16);
const derived = scryptSync(password, salt, 64).toString('hex');
const entry = { username, hash: `${salt.toString('hex')}:${derived}` };
const idx = accounts.findIndex((a) => a.username === username);
const mode = idx >= 0 ? '更新' : '新增';
if (idx >= 0) accounts[idx] = entry;
else accounts.push(entry);
// 原子写:先写临时文件再 rename,避免写到一半进程退出损坏数据
const tmp = ACCOUNTS_PATH + '.tmp';
writeFileSync(tmp, JSON.stringify(accounts, null, 2) + '\n', 'utf-8');
renameSync(tmp, ACCOUNTS_PATH);
console.log(`${mode}账号 "${username}" 成功 -> ${ACCOUNTS_PATH}`);
import { scrypt, randomBytes } from 'node:crypto';
import { existsSync, readFileSync, writeFileSync } from 'node:fs';
import { fileURLToPath } from 'node:url';
import path from 'node:path';
const here = path.dirname(fileURLToPath(import.meta.url));
const ACCOUNTS_PATH = path.resolve(here, '../data/accounts.json');
const [username, password] = process.argv.slice(2);
if (!username || !password) {
console.error('用法: pnpm --filter @hm/server gen:account <用户名> <密码>');
process.exit(1);
}
const salt = randomBytes(16);
const derived = scrypt(password, salt, 64).toString('hex');
const entry = { username, hash: `${salt.toString('hex')}:${derived}` };
const accounts = existsSync(ACCOUNTS_PATH)
? JSON.parse(readFileSync(ACCOUNTS_PATH, 'utf-8'))
: [];
const idx = accounts.findIndex((a) => a.username === username);
if (idx >= 0) accounts[idx] = entry;
else accounts.push(entry);
writeFileSync(ACCOUNTS_PATH, JSON.stringify(accounts, null, 2) + '\n', 'utf-8');
console.log(`已写入账号 "${username}" -> ${ACCOUNTS_PATH}`);
// 列出所有账号用户名(不打印哈希,哈希不可用于登录,仅作存在性核对)。
// 用法: pnpm --filter @hm/server list:accounts
import { existsSync, readFileSync } from 'node:fs';
import { fileURLToPath } from 'node:url';
import path from 'node:path';
const here = path.dirname(fileURLToPath(import.meta.url));
const ACCOUNTS_PATH = path.resolve(here, '../data/accounts.json');
if (!existsSync(ACCOUNTS_PATH)) {
console.log('(无账号文件)');
process.exit(0);
}
const accounts = JSON.parse(readFileSync(ACCOUNTS_PATH, 'utf-8'));
if (!accounts.length) {
console.log('(无账号)');
process.exit(0);
}
console.log(`共 ${accounts.length} 个账号:`);
for (const a of accounts) console.log(` - ${a.username}`);
// 删除账号。
// 用法: pnpm --filter @hm/server remove:account <用户名>
import { existsSync, readFileSync, writeFileSync, renameSync } from 'node:fs';
import { fileURLToPath } from 'node:url';
import path from 'node:path';
const here = path.dirname(fileURLToPath(import.meta.url));
const ACCOUNTS_PATH = path.resolve(here, '../data/accounts.json');
const username = process.argv[2];
if (!username) {
console.error('用法: pnpm --filter @hm/server remove:account <用户名>');
process.exit(1);
}
if (!existsSync(ACCOUNTS_PATH)) {
console.error('账号文件不存在');
process.exit(1);
}
const accounts = JSON.parse(readFileSync(ACCOUNTS_PATH, 'utf-8'));
const next = accounts.filter((a) => a.username !== username);
if (next.length === accounts.length) {
console.error(`未找到账号 "${username}"`);
process.exit(1);
}
const tmp = ACCOUNTS_PATH + '.tmp';
writeFileSync(tmp, JSON.stringify(next, null, 2) + '\n', 'utf-8');
renameSync(tmp, ACCOUNTS_PATH);
console.log(`已删除账号 "${username}"(剩余 ${next.length} 个)`);
import { scryptSync, timingSafeEqual } from 'node:crypto';
import { existsSync, readFileSync } from 'node:fs';
import { fileURLToPath } from 'node:url';
import path from 'node:path';
const here = path.dirname(fileURLToPath(import.meta.url));
const ACCOUNTS_PATH = path.resolve(here, '../data/accounts.json');
export interface Account {
username: string;
/** scrypt 哈希,格式 `salt(hex):derived(hex)`,salt 16 字节 / derived 64 字节 */
hash: string;
}
function splitHash(stored: string): { salt: Buffer; derived: Buffer } {
const [saltHex, derivedHex] = stored.split(':');
if (!saltHex || !derivedHex) throw new Error('账号哈希格式非法');
return { salt: Buffer.from(saltHex, 'hex'), derived: Buffer.from(derivedHex, 'hex') };
}
/** 用账号里存的 salt 对输入密码做 scrypt,timingSafeEqual 防时序侧信道 */
export function verifyPassword(password: string, stored: string): boolean {
const { salt, derived } = splitHash(stored);
const tryDerived = scryptSync(password, salt, derived.length);
return timingSafeEqual(derived, tryDerived);
}
export function loadAccounts(): Account[] {
if (!existsSync(ACCOUNTS_PATH)) return [];
return JSON.parse(readFileSync(ACCOUNTS_PATH, 'utf-8')) as Account[];
}
export function findAccount(username: string): Account | undefined {
return loadAccounts().find((a) => a.username === username);
}
// 容器首次启动初始化默认账号:仅当账号文件不存在、且配了 BOOTSTRAP_USER/BOOTSTRAP_PASSWORD 时。
// 已有账号文件则跳过(不覆盖,保护 volume 中已有数据)。哈希算法与 src/auth.ts 的 verifyPassword 一致。
import { scryptSync, randomBytes } from 'node:crypto';
import { existsSync, mkdirSync, writeFileSync, renameSync } from 'node:fs';
import { fileURLToPath } from 'node:url';
import path from 'node:path';
export function ensureBootstrapAccount(): void {
const here = path.dirname(fileURLToPath(import.meta.url));
const ACCOUNTS_PATH = path.resolve(here, '../data/accounts.json');
// 已有账号文件(宿主机挂 volume 或之前初始化过)→ 不覆盖
if (existsSync(ACCOUNTS_PATH)) return;
const user = process.env.BOOTSTRAP_USER;
const pwd = process.env.BOOTSTRAP_PASSWORD;
if (!user || !pwd) return; // 未提供 env → 不建账号,由运维挂 volume 或后续 add:account
const salt = randomBytes(16);
const derived = scryptSync(pwd, salt, 64).toString('hex');
mkdirSync(path.dirname(ACCOUNTS_PATH), { recursive: true });
const tmp = ACCOUNTS_PATH + '.tmp';
writeFileSync(tmp, JSON.stringify([{ username: user, hash: `${salt.toString('hex')}:${derived}` }], null, 2) + '\n');
renameSync(tmp, ACCOUNTS_PATH);
console.log(`[auth] 已从 BOOTSTRAP_USER 初始化账号 "${user}"`);
}
import 'dotenv/config';
import { existsSync, readFileSync, statSync } from 'node:fs';
import { extname, join, normalize } from 'node:path';
import { fileURLToPath } from 'node:url';
import path from 'node:path';
import { Hono } from 'hono';
import { serve } from '@hono/node-server';
import { findAccount, verifyPassword } from './auth';
import { signToken, verifyToken } from './jwt';
import { ensureBootstrapAccount } from './bootstrap';
const app = new Hono();
const PORT = Number(process.env.SERVER_PORT ?? 8787);
// 前端 vite build 产物在仓库根 dist/。生产全栈模式下由本服务同源托管。
const here = path.dirname(fileURLToPath(import.meta.url));
const DIST = path.resolve(here, '../../dist');
const MIME: Record<string, string> = {
'.html': 'text/html; charset=utf-8',
'.js': 'text/javascript; charset=utf-8',
'.css': 'text/css; charset=utf-8',
'.json': 'application/json; charset=utf-8',
'.svg': 'image/svg+xml',
'.png': 'image/png',
'.ico': 'image/x-icon',
'.woff2': 'font/woff2',
'.woff': 'font/woff',
'.ttf': 'font/ttf',
'.geojson': 'application/json',
'.map': 'application/json',
};
if (!process.env.AUTH_SECRET) {
console.warn('[auth] 未设置 AUTH_SECRET,使用不安全的开发默认密钥;生产环境务必在 .env 配置');
}
app.get('/api/health', (c) => c.json({ ok: true }));
app.post('/api/login', async (c) => {
let body: { username?: string; password?: string };
try {
body = await c.req.json();
} catch {
return c.json({ error: 'bad_request' }, 400);
}
const { username, password } = body;
if (!username || !password) return c.json({ error: 'bad_request' }, 400);
const acct = findAccount(username);
// 账号不存在与密码错误返回同一错误,避免暴露账号是否存在
if (!acct || !verifyPassword(password, acct.hash)) {
return c.json({ error: 'invalid_credentials' }, 401);
}
const token = await signToken(username);
return c.json({ token, user: { username } });
});
app.get('/api/me', async (c) => {
const auth = c.req.header('Authorization');
if (!auth?.startsWith('Bearer ')) return c.json({ error: 'no_token' }, 401);
const payload = await verifyToken(auth.slice(7));
if (!payload) return c.json({ error: 'invalid_token' }, 401);
return c.json({ user: { username: payload.username } });
});
// 无状态 JWT:后端不留存会话,登出由前端丢弃 token 完成
app.post('/api/logout', (c) => c.json({ ok: true }));
// 生产全栈模式:同源托管前端静态产物(dist/)并兜底 SPA 路由。
// dev 下 dist 不存在,此兜底返回 503 提示先 build;/api 已由上方路由处理,不会落入此处。
app.get('*', (c) => {
const { pathname } = new URL(c.req.url);
if (pathname.startsWith('/api')) return c.json({ error: 'not_found' }, 404);
const rel = pathname === '/' ? '/index.html' : pathname;
const filePath = normalize(join(DIST, decodeURIComponent(rel)));
if (
!filePath.startsWith(DIST) || // 防目录穿越
!existsSync(filePath) ||
!statSync(filePath).isFile()
) {
const index = join(DIST, 'index.html');
if (existsSync(index)) {
return c.body(readFileSync(index), 200, { 'Content-Type': 'text/html; charset=utf-8' });
}
return c.body('前端未构建:请先运行 pnpm build', 503);
}
const mime = MIME[extname(filePath)] ?? 'application/octet-stream';
return c.body(readFileSync(filePath), 200, { 'Content-Type': mime });
});
// 容器首次启动:无账号文件且配了 BOOTSTRAP_USER/PASSWORD 时初始化默认账号
ensureBootstrapAccount();
serve({ fetch: app.fetch, port: PORT }, (info) => {
console.log(`[auth] 登录服务已启动: http://localhost:${info.port}`);
});
import { SignJWT, jwtVerify } from 'jose';
const secret = new TextEncoder().encode(
process.env.AUTH_SECRET ?? 'dev-only-insecure-secret-change-me',
);
const EXP = '12h';
export async function signToken(username: string): Promise<string> {
return await new SignJWT({ username })
.setProtectedHeader({ alg: 'HS256' })
.setIssuedAt()
.setExpirationTime(EXP)
.sign(secret);
}
export async function verifyToken(token: string): Promise<{ username: string } | null> {
try {
const { payload } = await jwtVerify(token, secret);
if (typeof payload.username === 'string') return { username: payload.username };
return null;
} catch {
return null;
}
}
{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "Bundler",
"lib": ["ES2022"],
"types": ["node"],
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"noEmit": true,
"resolveJsonModule": true
},
"include": ["src", "scripts"]
}
...@@ -41,7 +41,7 @@ importers: ...@@ -41,7 +41,7 @@ importers:
devDependencies: devDependencies:
'@testing-library/jest-dom': '@testing-library/jest-dom':
specifier: ^7.0.1 specifier: ^7.0.1
version: 7.0.1(@testing-library/dom@10.4.2)(vitest@5.0.4(@types/node@26.6.5)(jsdom@30.1.2)(vite@6.4.4(@types/node@26.6.5)(yaml@2.9.1))) version: 7.0.1(@testing-library/dom@10.4.2)(vitest@5.0.4(@types/node@26.6.5)(jsdom@30.1.2)(vite@6.4.4(@types/node@26.6.5)(tsx@4.23.15)(yaml@2.9.1)))
'@testing-library/react': '@testing-library/react':
specifier: ^16.3.3 specifier: ^16.3.3
version: 16.3.3(@testing-library/dom@10.4.2)(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.0(react@19.3.0))(react@19.3.0) version: 16.3.3(@testing-library/dom@10.4.2)(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)
...@@ -59,7 +59,10 @@ importers: ...@@ -59,7 +59,10 @@ importers:
version: 8.71.2(eslint@9.39.5)(typescript@5.9.3) version: 8.71.2(eslint@9.39.5)(typescript@5.9.3)
'@vitejs/plugin-react': '@vitejs/plugin-react':
specifier: ^4.3.4 specifier: ^4.3.4
version: 4.7.0(vite@6.4.4(@types/node@26.6.5)(yaml@2.9.1)) version: 4.7.0(vite@6.4.4(@types/node@26.6.5)(tsx@4.23.15)(yaml@2.9.1))
concurrently:
specifier: ^9.1.0
version: 9.2.5
eslint: eslint:
specifier: ^9 specifier: ^9
version: 9.39.5 version: 9.39.5
...@@ -86,13 +89,35 @@ importers: ...@@ -86,13 +89,35 @@ importers:
version: 5.9.3 version: 5.9.3
vite: vite:
specifier: ^6.0.0 specifier: ^6.0.0
version: 6.4.4(@types/node@26.6.5)(yaml@2.9.1) version: 6.4.4(@types/node@26.6.5)(tsx@4.23.15)(yaml@2.9.1)
vitest: vitest:
specifier: ^5.0.2 specifier: ^5.0.2
version: 5.0.4(@types/node@26.6.5)(jsdom@30.1.2)(vite@6.4.4(@types/node@26.6.5)(yaml@2.9.1)) version: 5.0.4(@types/node@26.6.5)(jsdom@30.1.2)(vite@6.4.4(@types/node@26.6.5)(tsx@4.23.15)(yaml@2.9.1))
packages/map-overlay: {} packages/map-overlay: {}
packages/server:
dependencies:
'@hono/node-server':
specifier: ^1.13.0
version: 1.19.17(hono@4.13.14)
dotenv:
specifier: ^16.4.0
version: 16.6.1
hono:
specifier: ^4.6.0
version: 4.13.14
jose:
specifier: ^5.9.0
version: 5.10.0
devDependencies:
'@types/node':
specifier: ^22.0.0
version: 22.20.5
tsx:
specifier: ^4.19.0
version: 4.23.15
packages/ui: packages/ui:
dependencies: dependencies:
antd: antd:
...@@ -295,156 +320,312 @@ packages: ...@@ -295,156 +320,312 @@ packages:
cpu: [ppc64] cpu: [ppc64]
os: [aix] os: [aix]
'@esbuild/aix-ppc64@0.28.2':
resolution: {integrity: sha512-XExcO+dvLKvVtNTibSTBej1NCAbaGhWn9Ww1ZPx80qsahhPFe/8jgWP0IchNe0F3HwkU7n8ejhH8bjonqht8mQ==}
engines: {node: '>=18'}
cpu: [ppc64]
os: [aix]
'@esbuild/android-arm64@0.25.12': '@esbuild/android-arm64@0.25.12':
resolution: {integrity: sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==} resolution: {integrity: sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==}
engines: {node: '>=18'} engines: {node: '>=18'}
cpu: [arm64] cpu: [arm64]
os: [android] os: [android]
'@esbuild/android-arm64@0.28.2':
resolution: {integrity: sha512-5YfKeeI8qWfBZIX+u2xZC3Zlb3Os/gLS2sbEKM+I4ZOcsWmHS2WLysCcQZDAFRslDUU5Oiq44gf6PYN1vGwG5A==}
engines: {node: '>=18'}
cpu: [arm64]
os: [android]
'@esbuild/android-arm@0.25.12': '@esbuild/android-arm@0.25.12':
resolution: {integrity: sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==} resolution: {integrity: sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==}
engines: {node: '>=18'} engines: {node: '>=18'}
cpu: [arm] cpu: [arm]
os: [android] os: [android]
'@esbuild/android-arm@0.28.2':
resolution: {integrity: sha512-kXXoiPVVGQcnIYGOeaovwOURpniDBpSq4A03qkQ+BMQqtGG6HYap3xne9C1O1yo4TR3qxlCX5IqqmX6fFo2Lqg==}
engines: {node: '>=18'}
cpu: [arm]
os: [android]
'@esbuild/android-x64@0.25.12': '@esbuild/android-x64@0.25.12':
resolution: {integrity: sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==} resolution: {integrity: sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==}
engines: {node: '>=18'} engines: {node: '>=18'}
cpu: [x64] cpu: [x64]
os: [android] os: [android]
'@esbuild/android-x64@0.28.2':
resolution: {integrity: sha512-O387ite7SzUyCcy3JQX4P4bLtEA7bLLkx+esve5JHnyYfNTxcVpXZo9jhdB0lTKN44gztELTdU7nS8Nr16Fs1Q==}
engines: {node: '>=18'}
cpu: [x64]
os: [android]
'@esbuild/darwin-arm64@0.25.12': '@esbuild/darwin-arm64@0.25.12':
resolution: {integrity: sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==} resolution: {integrity: sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==}
engines: {node: '>=18'} engines: {node: '>=18'}
cpu: [arm64] cpu: [arm64]
os: [darwin] os: [darwin]
'@esbuild/darwin-arm64@0.28.2':
resolution: {integrity: sha512-n4KqkOQrraxHJcgjM1RvwbigfQKIKJVpM7xp+KsxiyUSrRdIXnt73VhrPAx0fV44hgfmIVKjxMN9J1t5jySVkw==}
engines: {node: '>=18'}
cpu: [arm64]
os: [darwin]
'@esbuild/darwin-x64@0.25.12': '@esbuild/darwin-x64@0.25.12':
resolution: {integrity: sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==} resolution: {integrity: sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==}
engines: {node: '>=18'} engines: {node: '>=18'}
cpu: [x64] cpu: [x64]
os: [darwin] os: [darwin]
'@esbuild/darwin-x64@0.28.2':
resolution: {integrity: sha512-uq6suIWYP37qzGddBKPw5QEQPi6HiLGsO7UmkpfyaYNQ3D+rN6w6WfwH+nuqcGXWvawGwxOEroO4YGnFh95azw==}
engines: {node: '>=18'}
cpu: [x64]
os: [darwin]
'@esbuild/freebsd-arm64@0.25.12': '@esbuild/freebsd-arm64@0.25.12':
resolution: {integrity: sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==} resolution: {integrity: sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==}
engines: {node: '>=18'} engines: {node: '>=18'}
cpu: [arm64] cpu: [arm64]
os: [freebsd] os: [freebsd]
'@esbuild/freebsd-arm64@0.28.2':
resolution: {integrity: sha512-n+I0BTSRIoy+d6RPKnEVwql5UwBJolytvY4mAOIEJorKlqgPII8ix6slVVrfZ5Tnj7glIZvloylbB/EJPMWEXw==}
engines: {node: '>=18'}
cpu: [arm64]
os: [freebsd]
'@esbuild/freebsd-x64@0.25.12': '@esbuild/freebsd-x64@0.25.12':
resolution: {integrity: sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==} resolution: {integrity: sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==}
engines: {node: '>=18'} engines: {node: '>=18'}
cpu: [x64] cpu: [x64]
os: [freebsd] os: [freebsd]
'@esbuild/freebsd-x64@0.28.2':
resolution: {integrity: sha512-78XJTJkvPs0kz2w61301PJjXl4g7q3JqiYMZ/M/yVI73EHBrCRTgkhu9oqG7vPqq+a/yadEW8aD+agKlk5xrmg==}
engines: {node: '>=18'}
cpu: [x64]
os: [freebsd]
'@esbuild/linux-arm64@0.25.12': '@esbuild/linux-arm64@0.25.12':
resolution: {integrity: sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==} resolution: {integrity: sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==}
engines: {node: '>=18'} engines: {node: '>=18'}
cpu: [arm64] cpu: [arm64]
os: [linux] os: [linux]
'@esbuild/linux-arm64@0.28.2':
resolution: {integrity: sha512-pW4AC0P3it8c7do9MVM4p51FzHzdM/TZrerurgRcHJ2WTa1VQ1CIq18xncfpBJw4ojkiZZrKW2yIBWBP92j6Ug==}
engines: {node: '>=18'}
cpu: [arm64]
os: [linux]
'@esbuild/linux-arm@0.25.12': '@esbuild/linux-arm@0.25.12':
resolution: {integrity: sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==} resolution: {integrity: sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==}
engines: {node: '>=18'} engines: {node: '>=18'}
cpu: [arm] cpu: [arm]
os: [linux] os: [linux]
'@esbuild/linux-arm@0.28.2':
resolution: {integrity: sha512-XlDnu2q5yoqems+xay6wSAcg9DDD7K9RLKZEBOMZm3ckNpJBvOX20tSfby8KfrrhINDyv9V2YVZKY/SpoGJI8w==}
engines: {node: '>=18'}
cpu: [arm]
os: [linux]
'@esbuild/linux-ia32@0.25.12': '@esbuild/linux-ia32@0.25.12':
resolution: {integrity: sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==} resolution: {integrity: sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==}
engines: {node: '>=18'} engines: {node: '>=18'}
cpu: [ia32] cpu: [ia32]
os: [linux] os: [linux]
'@esbuild/linux-ia32@0.28.2':
resolution: {integrity: sha512-CYbnj78HsIeA+DhgUKgFCfvNsTHFhMMrinUrMZpDXJXKN8T3XViTZ/+wtHeVxEWY8ewSzTFN+nRmSwO2tZaLUQ==}
engines: {node: '>=18'}
cpu: [ia32]
os: [linux]
'@esbuild/linux-loong64@0.25.12': '@esbuild/linux-loong64@0.25.12':
resolution: {integrity: sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==} resolution: {integrity: sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==}
engines: {node: '>=18'} engines: {node: '>=18'}
cpu: [loong64] cpu: [loong64]
os: [linux] os: [linux]
'@esbuild/linux-loong64@0.28.2':
resolution: {integrity: sha512-buwkd8nsph4R+ajRvw0qM5Hja/TXQow3ptzWO2EbG/cqcIkHloRrdlBtQlshyYGTNFvfkfJ5tpPLVkY4DtsPfQ==}
engines: {node: '>=18'}
cpu: [loong64]
os: [linux]
'@esbuild/linux-mips64el@0.25.12': '@esbuild/linux-mips64el@0.25.12':
resolution: {integrity: sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==} resolution: {integrity: sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==}
engines: {node: '>=18'} engines: {node: '>=18'}
cpu: [mips64el] cpu: [mips64el]
os: [linux] os: [linux]
'@esbuild/linux-mips64el@0.28.2':
resolution: {integrity: sha512-ZVykbDyk7519VwiNb9Lcj9m8XM6v5V9uKPvrEMkkEedVewf+0itkhahp4HDpgERXhwLRpWFypsGbG/J8s0QjJA==}
engines: {node: '>=18'}
cpu: [mips64el]
os: [linux]
'@esbuild/linux-ppc64@0.25.12': '@esbuild/linux-ppc64@0.25.12':
resolution: {integrity: sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==} resolution: {integrity: sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==}
engines: {node: '>=18'} engines: {node: '>=18'}
cpu: [ppc64] cpu: [ppc64]
os: [linux] os: [linux]
'@esbuild/linux-ppc64@0.28.2':
resolution: {integrity: sha512-CAXl+Dtd9UUuJd8pKKdwh6MLm3MUMiqMPmhZ3tTSXPqfyQ3vDl6R5hZdZ/kYojK4ofXtdfSv1tFq8XzWx3heNQ==}
engines: {node: '>=18'}
cpu: [ppc64]
os: [linux]
'@esbuild/linux-riscv64@0.25.12': '@esbuild/linux-riscv64@0.25.12':
resolution: {integrity: sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==} resolution: {integrity: sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==}
engines: {node: '>=18'} engines: {node: '>=18'}
cpu: [riscv64] cpu: [riscv64]
os: [linux] os: [linux]
'@esbuild/linux-riscv64@0.28.2':
resolution: {integrity: sha512-GeXCej4IQtU1B+QlDV8W/RRvbzI3O/Stss+/bCXv4lZls5WGRtu2a+3JkA3i4qIUlMXpcHebWpF8AkJhATowuA==}
engines: {node: '>=18'}
cpu: [riscv64]
os: [linux]
'@esbuild/linux-s390x@0.25.12': '@esbuild/linux-s390x@0.25.12':
resolution: {integrity: sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==} resolution: {integrity: sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==}
engines: {node: '>=18'} engines: {node: '>=18'}
cpu: [s390x] cpu: [s390x]
os: [linux] os: [linux]
'@esbuild/linux-s390x@0.28.2':
resolution: {integrity: sha512-3H1weTYZPxt/WOhByszQZybS9w5lKzUn1FDMsgEChbHWQwHYQQRfBxgCcZvPhjHfKyJjIievvMmEUawJrdY9Dg==}
engines: {node: '>=18'}
cpu: [s390x]
os: [linux]
'@esbuild/linux-x64@0.25.12': '@esbuild/linux-x64@0.25.12':
resolution: {integrity: sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==} resolution: {integrity: sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==}
engines: {node: '>=18'} engines: {node: '>=18'}
cpu: [x64] cpu: [x64]
os: [linux] os: [linux]
'@esbuild/linux-x64@0.28.2':
resolution: {integrity: sha512-4xTZr1FUmSoQW4XIWmit3tzQrUTZM+N3P0XV8xROKYF50XfI7xeO90+1bZvNwxIufQ9hDQVRJH5YhgPVF8A/HQ==}
engines: {node: '>=18'}
cpu: [x64]
os: [linux]
'@esbuild/netbsd-arm64@0.25.12': '@esbuild/netbsd-arm64@0.25.12':
resolution: {integrity: sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==} resolution: {integrity: sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==}
engines: {node: '>=18'} engines: {node: '>=18'}
cpu: [arm64] cpu: [arm64]
os: [netbsd] os: [netbsd]
'@esbuild/netbsd-arm64@0.28.2':
resolution: {integrity: sha512-sSATRjPeDBg3pdgHoQfoYBob11Kk1FGa9lui5RIHZCoCkJa9QKlvl3/vKz2usCmYYjs7ymJR/2Nnsqe+Hjt5nw==}
engines: {node: '>=18'}
cpu: [arm64]
os: [netbsd]
'@esbuild/netbsd-x64@0.25.12': '@esbuild/netbsd-x64@0.25.12':
resolution: {integrity: sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==} resolution: {integrity: sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==}
engines: {node: '>=18'} engines: {node: '>=18'}
cpu: [x64] cpu: [x64]
os: [netbsd] os: [netbsd]
'@esbuild/netbsd-x64@0.28.2':
resolution: {integrity: sha512-lqnzCV+mM0gIADaKihiCg6ifgfU2L3h5E33rNQBN1Y4MaVGnzryzmvvf7UHxprpQdE8hpqLolJ9Rl+SkIRDpyw==}
engines: {node: '>=18'}
cpu: [x64]
os: [netbsd]
'@esbuild/openbsd-arm64@0.25.12': '@esbuild/openbsd-arm64@0.25.12':
resolution: {integrity: sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==} resolution: {integrity: sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==}
engines: {node: '>=18'} engines: {node: '>=18'}
cpu: [arm64] cpu: [arm64]
os: [openbsd] os: [openbsd]
'@esbuild/openbsd-arm64@0.28.2':
resolution: {integrity: sha512-AL2qJILH7lNjrDmCQDvdxMfAUIv8KMNZOvrwAQ8i8//ntL9FflhOyMJ8OZSMBb8/AWXe3/5v5S20y3zCoZWKoQ==}
engines: {node: '>=18'}
cpu: [arm64]
os: [openbsd]
'@esbuild/openbsd-x64@0.25.12': '@esbuild/openbsd-x64@0.25.12':
resolution: {integrity: sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==} resolution: {integrity: sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==}
engines: {node: '>=18'} engines: {node: '>=18'}
cpu: [x64] cpu: [x64]
os: [openbsd] os: [openbsd]
'@esbuild/openbsd-x64@0.28.2':
resolution: {integrity: sha512-QtiuPytchRyC4rwUKhexJdQKvDuZ6hWloi3igqPQNUJCS1/v9EiO3UTOXR6A3FoMo4fnAKbWJdqaIwhOzh8qEw==}
engines: {node: '>=18'}
cpu: [x64]
os: [openbsd]
'@esbuild/openharmony-arm64@0.25.12': '@esbuild/openharmony-arm64@0.25.12':
resolution: {integrity: sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==} resolution: {integrity: sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==}
engines: {node: '>=18'} engines: {node: '>=18'}
cpu: [arm64] cpu: [arm64]
os: [openharmony] os: [openharmony]
'@esbuild/openharmony-arm64@0.28.2':
resolution: {integrity: sha512-WkhYDmpTjLvGlScA1rwjRUmhl4k8oXR3cIbtqWmELgU/dFeHHlEllxDvdWcNJV9rbzCexB5vz8gtNewWLgCT7Q==}
engines: {node: '>=18'}
cpu: [arm64]
os: [openharmony]
'@esbuild/sunos-x64@0.25.12': '@esbuild/sunos-x64@0.25.12':
resolution: {integrity: sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==} resolution: {integrity: sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==}
engines: {node: '>=18'} engines: {node: '>=18'}
cpu: [x64] cpu: [x64]
os: [sunos] os: [sunos]
'@esbuild/sunos-x64@0.28.2':
resolution: {integrity: sha512-GPMSkTOtMnv2U2F8gxe4Io6qmVs+YKyp832Etqqxr0hFngmXQ3rzwytelm3GIn7T4VviRUlf3sOgBOiTdvaf7g==}
engines: {node: '>=18'}
cpu: [x64]
os: [sunos]
'@esbuild/win32-arm64@0.25.12': '@esbuild/win32-arm64@0.25.12':
resolution: {integrity: sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==} resolution: {integrity: sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==}
engines: {node: '>=18'} engines: {node: '>=18'}
cpu: [arm64] cpu: [arm64]
os: [win32] os: [win32]
'@esbuild/win32-arm64@0.28.2':
resolution: {integrity: sha512-PIhhEkE9uPBleRBrQEJpUn7MBnibZzbGzYWPmY3x+YoVg/95zbjB4CxPPOQ8l5tYYM4mMaCthF8/1DIfBQQyWQ==}
engines: {node: '>=18'}
cpu: [arm64]
os: [win32]
'@esbuild/win32-ia32@0.25.12': '@esbuild/win32-ia32@0.25.12':
resolution: {integrity: sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==} resolution: {integrity: sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==}
engines: {node: '>=18'} engines: {node: '>=18'}
cpu: [ia32] cpu: [ia32]
os: [win32] os: [win32]
'@esbuild/win32-ia32@0.28.2':
resolution: {integrity: sha512-YmJbfTlvU7Sdn9BB+4PRES4oB6pxgS37MAONj+hBr/cpXS1aBPKXxNnDbu+QCWPj0o9dgyxeq79g6c5P8KeuYA==}
engines: {node: '>=18'}
cpu: [ia32]
os: [win32]
'@esbuild/win32-x64@0.25.12': '@esbuild/win32-x64@0.25.12':
resolution: {integrity: sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==} resolution: {integrity: sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==}
engines: {node: '>=18'} engines: {node: '>=18'}
cpu: [x64] cpu: [x64]
os: [win32] os: [win32]
'@esbuild/win32-x64@0.28.2':
resolution: {integrity: sha512-5ebpxr3nWMzrL/rnUI755Jkuee0bHL/Gq0WTF9lvcpv73wAp5eu8MfBUgWK9bhWvZjj7yX8etf/8tI8Ney695g==}
engines: {node: '>=18'}
cpu: [x64]
os: [win32]
'@eslint-community/eslint-utils@4.10.1': '@eslint-community/eslint-utils@4.10.1':
resolution: {integrity: sha512-cuadcxVFE8sDK6iWJbs8Sn0av2Nrh2QSGQhVlBW9AaAHqHwjWsZHT8LJ4hFGPh7ASBV2deFdM7H/DPjulmh8rg==} resolution: {integrity: sha512-cuadcxVFE8sDK6iWJbs8Sn0av2Nrh2QSGQhVlBW9AaAHqHwjWsZHT8LJ4hFGPh7ASBV2deFdM7H/DPjulmh8rg==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
...@@ -492,6 +673,12 @@ packages: ...@@ -492,6 +673,12 @@ packages:
'@noble/hashes': '@noble/hashes':
optional: true optional: true
'@hono/node-server@1.19.17':
resolution: {integrity: sha512-dSneS5qhiauZWGDCeK4o695Xd9nUNjviSZCMQrj10eetr8Uln1ucn6bbphOM6UynAMMtNIzZNSpL9vnASJwrPQ==}
engines: {node: '>=18.14.1'}
peerDependencies:
hono: ^4
'@humanfs/core@0.19.2': '@humanfs/core@0.19.2':
resolution: {integrity: sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==} resolution: {integrity: sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==}
engines: {node: '>=18.18.0'} engines: {node: '>=18.18.0'}
...@@ -1015,6 +1202,9 @@ packages: ...@@ -1015,6 +1202,9 @@ packages:
'@types/json-schema@7.0.15': '@types/json-schema@7.0.15':
resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==}
'@types/node@22.20.5':
resolution: {integrity: sha512-U2+DNr+wSjpsTS/wZGYHq7GcwfuSmKiKvoPvK22zwTlRhU91yOniN4qRR5KhIjvif7ysw/dz/hKmfDH0Ris4aA==}
'@types/node@26.6.5': '@types/node@26.6.5':
resolution: {integrity: sha512-uMzsv9stDdofIZBx4UGh4Z9ZgXnGC9seRDscilBcTHAeOFk67MZg/k9bWVfO+bk4qZmG+l52hRnLwUiH2LnJTg==} resolution: {integrity: sha512-uMzsv9stDdofIZBx4UGh4Z9ZgXnGC9seRDscilBcTHAeOFk67MZg/k9bWVfO+bk4qZmG+l52hRnLwUiH2LnJTg==}
...@@ -1206,6 +1396,10 @@ packages: ...@@ -1206,6 +1396,10 @@ packages:
resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==}
engines: {node: '>=18'} engines: {node: '>=18'}
cliui@8.0.1:
resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==}
engines: {node: '>=12'}
clsx@2.1.1: clsx@2.1.1:
resolution: {integrity: sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==} resolution: {integrity: sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==}
engines: {node: '>=6'} engines: {node: '>=6'}
...@@ -1234,6 +1428,11 @@ packages: ...@@ -1234,6 +1428,11 @@ packages:
concat-map@0.0.1: concat-map@0.0.1:
resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}
concurrently@9.2.5:
resolution: {integrity: sha512-YMZlvWrTPQEhjKp60XSmMGt60+pffbv6DyRnOMvVO98+J7aF8w8Ui9FhdcOwvSixc/kyR6SoVvmejcn/2lZBqg==}
engines: {node: '>=18'}
hasBin: true
convert-source-map@2.0.0: convert-source-map@2.0.0:
resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==}
...@@ -1292,12 +1491,19 @@ packages: ...@@ -1292,12 +1491,19 @@ packages:
dom-accessibility-api@0.6.3: dom-accessibility-api@0.6.3:
resolution: {integrity: sha512-7ZgogeTnjuHbo+ct10G9Ffp0mif17idi0IyWNVA/wcwcm7NPOD/WEHVP3n7n3MhXqxoIYm8d6MuZohYWIZ4T3w==} resolution: {integrity: sha512-7ZgogeTnjuHbo+ct10G9Ffp0mif17idi0IyWNVA/wcwcm7NPOD/WEHVP3n7n3MhXqxoIYm8d6MuZohYWIZ4T3w==}
dotenv@16.6.1:
resolution: {integrity: sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==}
engines: {node: '>=12'}
electron-to-chromium@1.5.453: electron-to-chromium@1.5.453:
resolution: {integrity: sha512-9r/nz9akllr3SZsHUhfK10ktUH6j0Dbo3cKdh91khw0FvR6HhXGnATmOq5X8ena2aq4GXLQ1koh3nvKaQJaNmQ==} resolution: {integrity: sha512-9r/nz9akllr3SZsHUhfK10ktUH6j0Dbo3cKdh91khw0FvR6HhXGnATmOq5X8ena2aq4GXLQ1koh3nvKaQJaNmQ==}
emoji-regex@10.6.0: emoji-regex@10.6.0:
resolution: {integrity: sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==} resolution: {integrity: sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==}
emoji-regex@8.0.0:
resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==}
entities@8.1.0: entities@8.1.0:
resolution: {integrity: sha512-kxL7msIffSuh9aaFAMD7rxAIuTRMAHMeBtgHW2yUdWw732ZNh4MehkF2gdjvtdmikkaIP9bFDDJOPlsvm7avrA==} resolution: {integrity: sha512-kxL7msIffSuh9aaFAMD7rxAIuTRMAHMeBtgHW2yUdWw732ZNh4MehkF2gdjvtdmikkaIP9bFDDJOPlsvm7avrA==}
engines: {node: '>=20.19.0'} engines: {node: '>=20.19.0'}
...@@ -1314,6 +1520,11 @@ packages: ...@@ -1314,6 +1520,11 @@ packages:
engines: {node: '>=18'} engines: {node: '>=18'}
hasBin: true hasBin: true
esbuild@0.28.2:
resolution: {integrity: sha512-HKVLS8dvII+xoKW9kmqxbRKrnWEXfJJr/FZhhJmiqIB0e053QNYFqOBouTMO/k5sID4MvCiUCvv8b9M4h32wIA==}
engines: {node: '>=18'}
hasBin: true
escalade@3.2.0: escalade@3.2.0:
resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==}
engines: {node: '>=6'} engines: {node: '>=6'}
...@@ -1445,6 +1656,10 @@ packages: ...@@ -1445,6 +1656,10 @@ packages:
resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==}
engines: {node: '>=6.9.0'} engines: {node: '>=6.9.0'}
get-caller-file@2.0.5:
resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==}
engines: {node: 6.* || 8.* || >= 10.*}
get-east-asian-width@1.7.0: get-east-asian-width@1.7.0:
resolution: {integrity: sha512-XjH1AECxf0giL2V1aU8vKyRR2ppRUb5c0EvT7zuJTokQ74bNo52zOtghqdWIqrhUD79fo3x0WfKZdOqxF6LG1Q==} resolution: {integrity: sha512-XjH1AECxf0giL2V1aU8vKyRR2ppRUb5c0EvT7zuJTokQ74bNo52zOtghqdWIqrhUD79fo3x0WfKZdOqxF6LG1Q==}
engines: {node: '>=18'} engines: {node: '>=18'}
...@@ -1465,6 +1680,10 @@ packages: ...@@ -1465,6 +1680,10 @@ packages:
resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==}
engines: {node: '>=8'} engines: {node: '>=8'}
hono@4.13.14:
resolution: {integrity: sha512-yhRLQ21U6qa9Hsu2N7Qcbh8tE+WKEcoErjIo56LeSGiGXGp9sA7UpE86Ui9uexb61KakiGwuHMn2QdV7w6i6kQ==}
engines: {node: '>=16.9.0'}
html-encoding-sniffer@7.0.0: html-encoding-sniffer@7.0.0:
resolution: {integrity: sha512-UikN5yr7xsCDAq87Or5or0PAlD3HJJOKVzM05az588WnpDJ4Ux7a2A53Qi6gofGg2/EtvF/H4hCi/TXfCW4Y6w==} resolution: {integrity: sha512-UikN5yr7xsCDAq87Or5or0PAlD3HJJOKVzM05az588WnpDJ4Ux7a2A53Qi6gofGg2/EtvF/H4hCi/TXfCW4Y6w==}
engines: {node: ^22.13.0 || >=24.0.0} engines: {node: ^22.13.0 || >=24.0.0}
...@@ -1498,6 +1717,10 @@ packages: ...@@ -1498,6 +1717,10 @@ packages:
resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==}
engines: {node: '>=0.10.0'} engines: {node: '>=0.10.0'}
is-fullwidth-code-point@3.0.0:
resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==}
engines: {node: '>=8'}
is-fullwidth-code-point@4.0.0: is-fullwidth-code-point@4.0.0:
resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==}
engines: {node: '>=12'} engines: {node: '>=12'}
...@@ -1527,6 +1750,9 @@ packages: ...@@ -1527,6 +1750,9 @@ packages:
isexe@2.0.0: isexe@2.0.0:
resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==}
jose@5.10.0:
resolution: {integrity: sha512-s+3Al/p9g32Iq+oqXxkW//7jk2Vig6FF1CFqzVXoTUXt2qz89YWbL+OwS17NFYEvxC35n0FKeGO2LGYSxeM2Gg==}
js-tokens@4.0.0: js-tokens@4.0.0:
resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==}
...@@ -1778,6 +2004,10 @@ packages: ...@@ -1778,6 +2004,10 @@ packages:
resolution: {integrity: sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==} resolution: {integrity: sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==}
engines: {node: '>=8'} engines: {node: '>=8'}
require-directory@2.1.1:
resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==}
engines: {node: '>=0.10.0'}
require-from-string@2.0.2: require-from-string@2.0.2:
resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==}
engines: {node: '>=0.10.0'} engines: {node: '>=0.10.0'}
...@@ -1798,6 +2028,9 @@ packages: ...@@ -1798,6 +2028,9 @@ packages:
engines: {node: '>=18.0.0', npm: '>=8.0.0'} engines: {node: '>=18.0.0', npm: '>=8.0.0'}
hasBin: true hasBin: true
rxjs@7.8.2:
resolution: {integrity: sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==}
saxes@6.0.0: saxes@6.0.0:
resolution: {integrity: sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==} resolution: {integrity: sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==}
engines: {node: '>=v12.22.7'} engines: {node: '>=v12.22.7'}
...@@ -1828,6 +2061,10 @@ packages: ...@@ -1828,6 +2061,10 @@ packages:
resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==}
engines: {node: '>=8'} engines: {node: '>=8'}
shell-quote@1.12.0:
resolution: {integrity: sha512-PcByqNyT/38F2kDNi006HAMRJaULuBzq/FOsw3qdZvX/GA9W/jamDaRskgHjubHiftXK5sIFxLNkvrXUwcof6Q==}
engines: {node: '>= 0.4'}
signal-exit@4.1.0: signal-exit@4.1.0:
resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==}
engines: {node: '>=14'} engines: {node: '>=14'}
...@@ -1858,10 +2095,18 @@ packages: ...@@ -1858,10 +2095,18 @@ packages:
string-convert@0.2.1: string-convert@0.2.1:
resolution: {integrity: sha512-u/1tdPl4yQnPBjnVrmdLo9gtuLvELKsAoRapekWggdiQNvvvum+jYF329d84NAa660KQw7pB2n36KrIKVoXa3A==} resolution: {integrity: sha512-u/1tdPl4yQnPBjnVrmdLo9gtuLvELKsAoRapekWggdiQNvvvum+jYF329d84NAa660KQw7pB2n36KrIKVoXa3A==}
string-width@4.2.3:
resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==}
engines: {node: '>=8'}
string-width@7.2.0: string-width@7.2.0:
resolution: {integrity: sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==} resolution: {integrity: sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==}
engines: {node: '>=18'} engines: {node: '>=18'}
strip-ansi@6.0.1:
resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==}
engines: {node: '>=8'}
strip-ansi@7.2.0: strip-ansi@7.2.0:
resolution: {integrity: sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==} resolution: {integrity: sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==}
engines: {node: '>=12'} engines: {node: '>=12'}
...@@ -1885,6 +2130,10 @@ packages: ...@@ -1885,6 +2130,10 @@ packages:
resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==}
engines: {node: '>=8'} engines: {node: '>=8'}
supports-color@8.1.1:
resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==}
engines: {node: '>=10'}
throttle-debounce@5.0.2: throttle-debounce@5.0.2:
resolution: {integrity: sha512-B71/4oyj61iNH0KeCamLuE2rmKuTO5byTOSVwECM5FA7TiAiAW+UqTKZ9ERueC4qvgSttUhdmq1mXC3kJqGX7A==} resolution: {integrity: sha512-B71/4oyj61iNH0KeCamLuE2rmKuTO5byTOSVwECM5FA7TiAiAW+UqTKZ9ERueC4qvgSttUhdmq1mXC3kJqGX7A==}
engines: {node: '>=12.22'} engines: {node: '>=12.22'}
...@@ -1920,12 +2169,24 @@ packages: ...@@ -1920,12 +2169,24 @@ packages:
resolution: {integrity: sha512-BcDSDW+SIGWVOns1Zm6Yg91q9AEj7eaID0QDY9oIqJD1A8dscNwMcl9Sms2DeuWCNov1X0/oXanHGYQBSLwZsg==} resolution: {integrity: sha512-BcDSDW+SIGWVOns1Zm6Yg91q9AEj7eaID0QDY9oIqJD1A8dscNwMcl9Sms2DeuWCNov1X0/oXanHGYQBSLwZsg==}
engines: {node: ^22.14.0 || >=24.0.0} engines: {node: ^22.14.0 || >=24.0.0}
tree-kill@1.2.2:
resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==}
hasBin: true
ts-api-utils@2.5.0: ts-api-utils@2.5.0:
resolution: {integrity: sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA==} resolution: {integrity: sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA==}
engines: {node: '>=18.12'} engines: {node: '>=18.12'}
peerDependencies: peerDependencies:
typescript: '>=4.8.4' typescript: '>=4.8.4'
tslib@2.8.1:
resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==}
tsx@4.23.15:
resolution: {integrity: sha512-Yiex1Ovn8z2xPpOWckIiysV1SSyRMY9BkLF++q0yKiDxCqRhosKfMg3janKkiLBwZ5c/YryloKwGZcrEmtwxKw==}
engines: {node: '>=18.0.0'}
hasBin: true
type-check@0.4.0: type-check@0.4.0:
resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==}
engines: {node: '>= 0.8.0'} engines: {node: '>= 0.8.0'}
...@@ -1935,6 +2196,9 @@ packages: ...@@ -1935,6 +2196,9 @@ packages:
engines: {node: '>=14.17'} engines: {node: '>=14.17'}
hasBin: true hasBin: true
undici-types@6.21.0:
resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==}
undici-types@8.9.0: undici-types@8.9.0:
resolution: {integrity: sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg==} resolution: {integrity: sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg==}
...@@ -2070,6 +2334,10 @@ packages: ...@@ -2070,6 +2334,10 @@ packages:
resolution: {integrity: sha512-OELeY0Q61OXpdUfTp+oweA/vtLVg5VDOXh+3he3PNzLGG/y0oylSOC1xRVj0+l4vQ3tj/bB1HVHv1ocXkQceFA==} resolution: {integrity: sha512-OELeY0Q61OXpdUfTp+oweA/vtLVg5VDOXh+3he3PNzLGG/y0oylSOC1xRVj0+l4vQ3tj/bB1HVHv1ocXkQceFA==}
engines: {node: '>=0.8'} engines: {node: '>=0.8'}
wrap-ansi@7.0.0:
resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==}
engines: {node: '>=10'}
wrap-ansi@9.0.2: wrap-ansi@9.0.2:
resolution: {integrity: sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==} resolution: {integrity: sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==}
engines: {node: '>=18'} engines: {node: '>=18'}
...@@ -2086,6 +2354,10 @@ packages: ...@@ -2086,6 +2354,10 @@ packages:
xmlchars@2.2.0: xmlchars@2.2.0:
resolution: {integrity: sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==} resolution: {integrity: sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==}
y18n@5.0.8:
resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==}
engines: {node: '>=10'}
yallist@3.1.1: yallist@3.1.1:
resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==}
...@@ -2094,6 +2366,14 @@ packages: ...@@ -2094,6 +2366,14 @@ packages:
engines: {node: '>= 14.6'} engines: {node: '>= 14.6'}
hasBin: true hasBin: true
yargs-parser@21.1.1:
resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==}
engines: {node: '>=12'}
yargs@17.7.2:
resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==}
engines: {node: '>=12'}
yocto-queue@0.1.0: yocto-queue@0.1.0:
resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==}
engines: {node: '>=10'} engines: {node: '>=10'}
...@@ -2332,81 +2612,159 @@ snapshots: ...@@ -2332,81 +2612,159 @@ snapshots:
'@esbuild/aix-ppc64@0.25.12': '@esbuild/aix-ppc64@0.25.12':
optional: true optional: true
'@esbuild/aix-ppc64@0.28.2':
optional: true
'@esbuild/android-arm64@0.25.12': '@esbuild/android-arm64@0.25.12':
optional: true optional: true
'@esbuild/android-arm64@0.28.2':
optional: true
'@esbuild/android-arm@0.25.12': '@esbuild/android-arm@0.25.12':
optional: true optional: true
'@esbuild/android-arm@0.28.2':
optional: true
'@esbuild/android-x64@0.25.12': '@esbuild/android-x64@0.25.12':
optional: true optional: true
'@esbuild/android-x64@0.28.2':
optional: true
'@esbuild/darwin-arm64@0.25.12': '@esbuild/darwin-arm64@0.25.12':
optional: true optional: true
'@esbuild/darwin-arm64@0.28.2':
optional: true
'@esbuild/darwin-x64@0.25.12': '@esbuild/darwin-x64@0.25.12':
optional: true optional: true
'@esbuild/darwin-x64@0.28.2':
optional: true
'@esbuild/freebsd-arm64@0.25.12': '@esbuild/freebsd-arm64@0.25.12':
optional: true optional: true
'@esbuild/freebsd-arm64@0.28.2':
optional: true
'@esbuild/freebsd-x64@0.25.12': '@esbuild/freebsd-x64@0.25.12':
optional: true optional: true
'@esbuild/freebsd-x64@0.28.2':
optional: true
'@esbuild/linux-arm64@0.25.12': '@esbuild/linux-arm64@0.25.12':
optional: true optional: true
'@esbuild/linux-arm64@0.28.2':
optional: true
'@esbuild/linux-arm@0.25.12': '@esbuild/linux-arm@0.25.12':
optional: true optional: true
'@esbuild/linux-arm@0.28.2':
optional: true
'@esbuild/linux-ia32@0.25.12': '@esbuild/linux-ia32@0.25.12':
optional: true optional: true
'@esbuild/linux-ia32@0.28.2':
optional: true
'@esbuild/linux-loong64@0.25.12': '@esbuild/linux-loong64@0.25.12':
optional: true optional: true
'@esbuild/linux-loong64@0.28.2':
optional: true
'@esbuild/linux-mips64el@0.25.12': '@esbuild/linux-mips64el@0.25.12':
optional: true optional: true
'@esbuild/linux-mips64el@0.28.2':
optional: true
'@esbuild/linux-ppc64@0.25.12': '@esbuild/linux-ppc64@0.25.12':
optional: true optional: true
'@esbuild/linux-ppc64@0.28.2':
optional: true
'@esbuild/linux-riscv64@0.25.12': '@esbuild/linux-riscv64@0.25.12':
optional: true optional: true
'@esbuild/linux-riscv64@0.28.2':
optional: true
'@esbuild/linux-s390x@0.25.12': '@esbuild/linux-s390x@0.25.12':
optional: true optional: true
'@esbuild/linux-s390x@0.28.2':
optional: true
'@esbuild/linux-x64@0.25.12': '@esbuild/linux-x64@0.25.12':
optional: true optional: true
'@esbuild/linux-x64@0.28.2':
optional: true
'@esbuild/netbsd-arm64@0.25.12': '@esbuild/netbsd-arm64@0.25.12':
optional: true optional: true
'@esbuild/netbsd-arm64@0.28.2':
optional: true
'@esbuild/netbsd-x64@0.25.12': '@esbuild/netbsd-x64@0.25.12':
optional: true optional: true
'@esbuild/netbsd-x64@0.28.2':
optional: true
'@esbuild/openbsd-arm64@0.25.12': '@esbuild/openbsd-arm64@0.25.12':
optional: true optional: true
'@esbuild/openbsd-arm64@0.28.2':
optional: true
'@esbuild/openbsd-x64@0.25.12': '@esbuild/openbsd-x64@0.25.12':
optional: true optional: true
'@esbuild/openbsd-x64@0.28.2':
optional: true
'@esbuild/openharmony-arm64@0.25.12': '@esbuild/openharmony-arm64@0.25.12':
optional: true optional: true
'@esbuild/openharmony-arm64@0.28.2':
optional: true
'@esbuild/sunos-x64@0.25.12': '@esbuild/sunos-x64@0.25.12':
optional: true optional: true
'@esbuild/sunos-x64@0.28.2':
optional: true
'@esbuild/win32-arm64@0.25.12': '@esbuild/win32-arm64@0.25.12':
optional: true optional: true
'@esbuild/win32-arm64@0.28.2':
optional: true
'@esbuild/win32-ia32@0.25.12': '@esbuild/win32-ia32@0.25.12':
optional: true optional: true
'@esbuild/win32-ia32@0.28.2':
optional: true
'@esbuild/win32-x64@0.25.12': '@esbuild/win32-x64@0.25.12':
optional: true optional: true
'@esbuild/win32-x64@0.28.2':
optional: true
'@eslint-community/eslint-utils@4.10.1(eslint@9.39.5)': '@eslint-community/eslint-utils@4.10.1(eslint@9.39.5)':
dependencies: dependencies:
eslint: 9.39.5 eslint: 9.39.5
...@@ -2455,6 +2813,10 @@ snapshots: ...@@ -2455,6 +2813,10 @@ snapshots:
'@exodus/bytes@1.16.0': {} '@exodus/bytes@1.16.0': {}
'@hono/node-server@1.19.17(hono@4.13.14)':
dependencies:
hono: 4.13.14
'@humanfs/core@0.19.2': '@humanfs/core@0.19.2':
dependencies: dependencies:
'@humanfs/types': 0.15.0 '@humanfs/types': 0.15.0
...@@ -2929,7 +3291,7 @@ snapshots: ...@@ -2929,7 +3291,7 @@ snapshots:
picocolors: 1.1.1 picocolors: 1.1.1
pretty-format: 27.5.1 pretty-format: 27.5.1
'@testing-library/jest-dom@7.0.1(@testing-library/dom@10.4.2)(vitest@5.0.4(@types/node@26.6.5)(jsdom@30.1.2)(vite@6.4.4(@types/node@26.6.5)(yaml@2.9.1)))': '@testing-library/jest-dom@7.0.1(@testing-library/dom@10.4.2)(vitest@5.0.4(@types/node@26.6.5)(jsdom@30.1.2)(vite@6.4.4(@types/node@26.6.5)(tsx@4.23.15)(yaml@2.9.1)))':
dependencies: dependencies:
'@adobe/css-tools': 4.5.0 '@adobe/css-tools': 4.5.0
'@testing-library/dom': 10.4.2 '@testing-library/dom': 10.4.2
...@@ -2939,7 +3301,7 @@ snapshots: ...@@ -2939,7 +3301,7 @@ snapshots:
picocolors: 1.1.1 picocolors: 1.1.1
redent: 3.0.0 redent: 3.0.0
optionalDependencies: optionalDependencies:
vitest: 5.0.4(@types/node@26.6.5)(jsdom@30.1.2)(vite@6.4.4(@types/node@26.6.5)(yaml@2.9.1)) vitest: 5.0.4(@types/node@26.6.5)(jsdom@30.1.2)(vite@6.4.4(@types/node@26.6.5)(tsx@4.23.15)(yaml@2.9.1))
'@testing-library/react@16.3.3(@testing-library/dom@10.4.2)(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)': '@testing-library/react@16.3.3(@testing-library/dom@10.4.2)(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)':
dependencies: dependencies:
...@@ -2985,6 +3347,10 @@ snapshots: ...@@ -2985,6 +3347,10 @@ snapshots:
'@types/json-schema@7.0.15': {} '@types/json-schema@7.0.15': {}
'@types/node@22.20.5':
dependencies:
undici-types: 6.21.0
'@types/node@26.6.5': '@types/node@26.6.5':
dependencies: dependencies:
undici-types: 8.9.0 undici-types: 8.9.0
...@@ -3049,7 +3415,7 @@ snapshots: ...@@ -3049,7 +3415,7 @@ snapshots:
'@typescript-eslint/types': 8.71.2 '@typescript-eslint/types': 8.71.2
eslint-visitor-keys: 5.0.1 eslint-visitor-keys: 5.0.1
'@vitejs/plugin-react@4.7.0(vite@6.4.4(@types/node@26.6.5)(yaml@2.9.1))': '@vitejs/plugin-react@4.7.0(vite@6.4.4(@types/node@26.6.5)(tsx@4.23.15)(yaml@2.9.1))':
dependencies: dependencies:
'@babel/core': 7.29.7 '@babel/core': 7.29.7
'@babel/plugin-transform-react-jsx-self': 7.29.7(@babel/core@7.29.7) '@babel/plugin-transform-react-jsx-self': 7.29.7(@babel/core@7.29.7)
...@@ -3057,18 +3423,18 @@ snapshots: ...@@ -3057,18 +3423,18 @@ snapshots:
'@rolldown/pluginutils': 1.0.0-beta.27 '@rolldown/pluginutils': 1.0.0-beta.27
'@types/babel__core': 7.20.5 '@types/babel__core': 7.20.5
react-refresh: 0.17.0 react-refresh: 0.17.0
vite: 6.4.4(@types/node@26.6.5)(yaml@2.9.1) vite: 6.4.4(@types/node@26.6.5)(tsx@4.23.15)(yaml@2.9.1)
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
'@vitest/mocker@5.0.4(vite@6.4.4(@types/node@26.6.5)(yaml@2.9.1))': '@vitest/mocker@5.0.4(vite@6.4.4(@types/node@26.6.5)(tsx@4.23.15)(yaml@2.9.1))':
dependencies: dependencies:
'@jridgewell/trace-mapping': 0.3.31 '@jridgewell/trace-mapping': 0.3.31
'@vitest/spy': 5.0.4 '@vitest/spy': 5.0.4
estree-walker: 3.0.3 estree-walker: 3.0.3
magic-string: 1.4.3 magic-string: 1.4.3
optionalDependencies: optionalDependencies:
vite: 6.4.4(@types/node@26.6.5)(yaml@2.9.1) vite: 6.4.4(@types/node@26.6.5)(tsx@4.23.15)(yaml@2.9.1)
'@vitest/spy@5.0.4': {} '@vitest/spy@5.0.4': {}
...@@ -3228,6 +3594,12 @@ snapshots: ...@@ -3228,6 +3594,12 @@ snapshots:
slice-ansi: 5.0.0 slice-ansi: 5.0.0
string-width: 7.2.0 string-width: 7.2.0
cliui@8.0.1:
dependencies:
string-width: 4.2.3
strip-ansi: 6.0.1
wrap-ansi: 7.0.0
clsx@2.1.1: {} clsx@2.1.1: {}
codepage@1.15.0: {} codepage@1.15.0: {}
...@@ -3246,6 +3618,15 @@ snapshots: ...@@ -3246,6 +3618,15 @@ snapshots:
concat-map@0.0.1: {} concat-map@0.0.1: {}
concurrently@9.2.5:
dependencies:
chalk: 4.1.2
rxjs: 7.8.2
shell-quote: 1.12.0
supports-color: 8.1.1
tree-kill: 1.2.2
yargs: 17.7.2
convert-source-map@2.0.0: {} convert-source-map@2.0.0: {}
cookie@1.1.1: {} cookie@1.1.1: {}
...@@ -3290,10 +3671,14 @@ snapshots: ...@@ -3290,10 +3671,14 @@ snapshots:
dom-accessibility-api@0.6.3: {} dom-accessibility-api@0.6.3: {}
dotenv@16.6.1: {}
electron-to-chromium@1.5.453: {} electron-to-chromium@1.5.453: {}
emoji-regex@10.6.0: {} emoji-regex@10.6.0: {}
emoji-regex@8.0.0: {}
entities@8.1.0: {} entities@8.1.0: {}
environment@1.1.0: {} environment@1.1.0: {}
...@@ -3329,6 +3714,35 @@ snapshots: ...@@ -3329,6 +3714,35 @@ snapshots:
'@esbuild/win32-ia32': 0.25.12 '@esbuild/win32-ia32': 0.25.12
'@esbuild/win32-x64': 0.25.12 '@esbuild/win32-x64': 0.25.12
esbuild@0.28.2:
optionalDependencies:
'@esbuild/aix-ppc64': 0.28.2
'@esbuild/android-arm': 0.28.2
'@esbuild/android-arm64': 0.28.2
'@esbuild/android-x64': 0.28.2
'@esbuild/darwin-arm64': 0.28.2
'@esbuild/darwin-x64': 0.28.2
'@esbuild/freebsd-arm64': 0.28.2
'@esbuild/freebsd-x64': 0.28.2
'@esbuild/linux-arm': 0.28.2
'@esbuild/linux-arm64': 0.28.2
'@esbuild/linux-ia32': 0.28.2
'@esbuild/linux-loong64': 0.28.2
'@esbuild/linux-mips64el': 0.28.2
'@esbuild/linux-ppc64': 0.28.2
'@esbuild/linux-riscv64': 0.28.2
'@esbuild/linux-s390x': 0.28.2
'@esbuild/linux-x64': 0.28.2
'@esbuild/netbsd-arm64': 0.28.2
'@esbuild/netbsd-x64': 0.28.2
'@esbuild/openbsd-arm64': 0.28.2
'@esbuild/openbsd-x64': 0.28.2
'@esbuild/openharmony-arm64': 0.28.2
'@esbuild/sunos-x64': 0.28.2
'@esbuild/win32-arm64': 0.28.2
'@esbuild/win32-ia32': 0.28.2
'@esbuild/win32-x64': 0.28.2
escalade@3.2.0: {} escalade@3.2.0: {}
escape-string-regexp@4.0.0: {} escape-string-regexp@4.0.0: {}
...@@ -3466,6 +3880,8 @@ snapshots: ...@@ -3466,6 +3880,8 @@ snapshots:
gensync@1.0.0-beta.2: {} gensync@1.0.0-beta.2: {}
get-caller-file@2.0.5: {}
get-east-asian-width@1.7.0: {} get-east-asian-width@1.7.0: {}
get-stream@8.0.1: {} get-stream@8.0.1: {}
...@@ -3478,6 +3894,8 @@ snapshots: ...@@ -3478,6 +3894,8 @@ snapshots:
has-flag@4.0.0: {} has-flag@4.0.0: {}
hono@4.13.14: {}
html-encoding-sniffer@7.0.0: html-encoding-sniffer@7.0.0:
dependencies: dependencies:
'@exodus/bytes': 1.16.0 '@exodus/bytes': 1.16.0
...@@ -3501,6 +3919,8 @@ snapshots: ...@@ -3501,6 +3919,8 @@ snapshots:
is-extglob@2.1.1: {} is-extglob@2.1.1: {}
is-fullwidth-code-point@3.0.0: {}
is-fullwidth-code-point@4.0.0: {} is-fullwidth-code-point@4.0.0: {}
is-fullwidth-code-point@5.1.0: is-fullwidth-code-point@5.1.0:
...@@ -3521,6 +3941,8 @@ snapshots: ...@@ -3521,6 +3941,8 @@ snapshots:
isexe@2.0.0: {} isexe@2.0.0: {}
jose@5.10.0: {}
js-tokens@4.0.0: {} js-tokens@4.0.0: {}
js-yaml@4.3.2: js-yaml@4.3.2:
...@@ -3761,6 +4183,8 @@ snapshots: ...@@ -3761,6 +4183,8 @@ snapshots:
indent-string: 4.0.0 indent-string: 4.0.0
strip-indent: 3.0.0 strip-indent: 3.0.0
require-directory@2.1.1: {}
require-from-string@2.0.2: {} require-from-string@2.0.2: {}
resolve-from@4.0.0: {} resolve-from@4.0.0: {}
...@@ -3804,6 +4228,10 @@ snapshots: ...@@ -3804,6 +4228,10 @@ snapshots:
'@rollup/rollup-win32-x64-msvc': 4.64.5 '@rollup/rollup-win32-x64-msvc': 4.64.5
fsevents: 2.3.3 fsevents: 2.3.3
rxjs@7.8.2:
dependencies:
tslib: 2.8.1
saxes@6.0.0: saxes@6.0.0:
dependencies: dependencies:
xmlchars: 2.2.0 xmlchars: 2.2.0
...@@ -3826,6 +4254,8 @@ snapshots: ...@@ -3826,6 +4254,8 @@ snapshots:
shebang-regex@3.0.0: {} shebang-regex@3.0.0: {}
shell-quote@1.12.0: {}
signal-exit@4.1.0: {} signal-exit@4.1.0: {}
slice-ansi@5.0.0: slice-ansi@5.0.0:
...@@ -3850,12 +4280,22 @@ snapshots: ...@@ -3850,12 +4280,22 @@ snapshots:
string-convert@0.2.1: {} string-convert@0.2.1: {}
string-width@4.2.3:
dependencies:
emoji-regex: 8.0.0
is-fullwidth-code-point: 3.0.0
strip-ansi: 6.0.1
string-width@7.2.0: string-width@7.2.0:
dependencies: dependencies:
emoji-regex: 10.6.0 emoji-regex: 10.6.0
get-east-asian-width: 1.7.0 get-east-asian-width: 1.7.0
strip-ansi: 7.2.0 strip-ansi: 7.2.0
strip-ansi@6.0.1:
dependencies:
ansi-regex: 5.0.1
strip-ansi@7.2.0: strip-ansi@7.2.0:
dependencies: dependencies:
ansi-regex: 6.4.0 ansi-regex: 6.4.0
...@@ -3874,6 +4314,10 @@ snapshots: ...@@ -3874,6 +4314,10 @@ snapshots:
dependencies: dependencies:
has-flag: 4.0.0 has-flag: 4.0.0
supports-color@8.1.1:
dependencies:
has-flag: 4.0.0
throttle-debounce@5.0.2: {} throttle-debounce@5.0.2: {}
tinybench@6.2.2: {} tinybench@6.2.2: {}
...@@ -3903,16 +4347,28 @@ snapshots: ...@@ -3903,16 +4347,28 @@ snapshots:
dependencies: dependencies:
punycode: 2.3.1 punycode: 2.3.1
tree-kill@1.2.2: {}
ts-api-utils@2.5.0(typescript@5.9.3): ts-api-utils@2.5.0(typescript@5.9.3):
dependencies: dependencies:
typescript: 5.9.3 typescript: 5.9.3
tslib@2.8.1: {}
tsx@4.23.15:
dependencies:
esbuild: 0.28.2
optionalDependencies:
fsevents: 2.3.3
type-check@0.4.0: type-check@0.4.0:
dependencies: dependencies:
prelude-ls: 1.2.1 prelude-ls: 1.2.1
typescript@5.9.3: {} typescript@5.9.3: {}
undici-types@6.21.0: {}
undici-types@8.9.0: {} undici-types@8.9.0: {}
undici@8.11.2: {} undici@8.11.2: {}
...@@ -3927,7 +4383,7 @@ snapshots: ...@@ -3927,7 +4383,7 @@ snapshots:
dependencies: dependencies:
punycode: 2.3.1 punycode: 2.3.1
vite@6.4.4(@types/node@26.6.5)(yaml@2.9.1): vite@6.4.4(@types/node@26.6.5)(tsx@4.23.15)(yaml@2.9.1):
dependencies: dependencies:
esbuild: 0.25.12 esbuild: 0.25.12
fdir: 6.5.0(picomatch@4.0.7) fdir: 6.5.0(picomatch@4.0.7)
...@@ -3938,12 +4394,13 @@ snapshots: ...@@ -3938,12 +4394,13 @@ snapshots:
optionalDependencies: optionalDependencies:
'@types/node': 26.6.5 '@types/node': 26.6.5
fsevents: 2.3.3 fsevents: 2.3.3
tsx: 4.23.15
yaml: 2.9.1 yaml: 2.9.1
vitest@5.0.4(@types/node@26.6.5)(jsdom@30.1.2)(vite@6.4.4(@types/node@26.6.5)(yaml@2.9.1)): vitest@5.0.4(@types/node@26.6.5)(jsdom@30.1.2)(vite@6.4.4(@types/node@26.6.5)(tsx@4.23.15)(yaml@2.9.1)):
dependencies: dependencies:
'@types/chai': 5.2.3 '@types/chai': 5.2.3
'@vitest/mocker': 5.0.4(vite@6.4.4(@types/node@26.6.5)(yaml@2.9.1)) '@vitest/mocker': 5.0.4(vite@6.4.4(@types/node@26.6.5)(tsx@4.23.15)(yaml@2.9.1))
chai: 6.3.0 chai: 6.3.0
es-module-lexer: 2.3.2 es-module-lexer: 2.3.2
expect-type: 1.4.0 expect-type: 1.4.0
...@@ -3954,7 +4411,7 @@ snapshots: ...@@ -3954,7 +4411,7 @@ snapshots:
tinybench: 6.2.2 tinybench: 6.2.2
tinyexec: 1.3.1 tinyexec: 1.3.1
tinyglobby: 0.2.17 tinyglobby: 0.2.17
vite: 6.4.4(@types/node@26.6.5)(yaml@2.9.1) vite: 6.4.4(@types/node@26.6.5)(tsx@4.23.15)(yaml@2.9.1)
why-is-node-running: 3.2.1 why-is-node-running: 3.2.1
optionalDependencies: optionalDependencies:
'@types/node': 26.6.5 '@types/node': 26.6.5
...@@ -3990,6 +4447,12 @@ snapshots: ...@@ -3990,6 +4447,12 @@ snapshots:
word@0.3.0: {} word@0.3.0: {}
wrap-ansi@7.0.0:
dependencies:
ansi-styles: 4.3.0
string-width: 4.2.3
strip-ansi: 6.0.1
wrap-ansi@9.0.2: wrap-ansi@9.0.2:
dependencies: dependencies:
ansi-styles: 6.2.3 ansi-styles: 6.2.3
...@@ -4010,10 +4473,24 @@ snapshots: ...@@ -4010,10 +4473,24 @@ snapshots:
xmlchars@2.2.0: {} xmlchars@2.2.0: {}
y18n@5.0.8: {}
yallist@3.1.1: {} yallist@3.1.1: {}
yaml@2.9.1: {} yaml@2.9.1: {}
yargs-parser@21.1.1: {}
yargs@17.7.2:
dependencies:
cliui: 8.0.1
escalade: 3.2.0
get-caller-file: 2.0.5
require-directory: 2.1.1
string-width: 4.2.3
y18n: 5.0.8
yargs-parser: 21.1.1
yocto-queue@0.1.0: {} yocto-queue@0.1.0: {}
zustand@5.0.15(@types/react@19.3.0)(react@19.3.0): zustand@5.0.15(@types/react@19.3.0)(react@19.3.0):
......
import { useEffect } from 'react'; import { useEffect } from 'react';
import { App as AntdApp, ConfigProvider } from 'antd';
import zhCN from 'antd/locale/zh_CN';
import { themeConfig } from '@/theme/themeConfig';
import { useBootstrap } from '@/features/heatmap/useBootstrap'; import { useBootstrap } from '@/features/heatmap/useBootstrap';
import { HeaderBar } from '@/layout/HeaderBar'; import { HeaderBar } from '@/layout/HeaderBar';
import { MapStage } from '@/features/heatmap/MapStage'; import { MapStage } from '@/features/heatmap/MapStage';
...@@ -55,9 +52,7 @@ export default function App() { ...@@ -55,9 +52,7 @@ export default function App() {
.join(' '); .join(' ');
return ( return (
<ConfigProvider locale={zhCN} theme={themeConfig}> <div className="hm-app">
<AntdApp>
<div className="hm-app">
<HeaderBar /> <HeaderBar />
<div className={bodyClass}> <div className={bodyClass}>
<MapStage /> <MapStage />
...@@ -67,7 +62,5 @@ export default function App() { ...@@ -67,7 +62,5 @@ export default function App() {
<CaseListDrawer /> <CaseListDrawer />
<StatsBoardDrawer /> <StatsBoardDrawer />
</div> </div>
</AntdApp>
</ConfigProvider>
); );
} }
import { Component, type ReactNode } from 'react';
interface Props {
children: ReactNode;
}
interface State {
error: Error | null;
}
/**
* 顶层错误边界:任何渲染期 / 卸载期异常(如地图组件 dispose 抛错)都不该让整页变白。
* 兜底显示可读信息 + 返回登录按钮,而不是 silent 白屏。
*/
export class ErrorBoundary extends Component<Props, State> {
state: State = { error: null };
static getDerivedStateFromError(error: Error): State {
return { error };
}
componentDidCatch(error: Error, info: unknown) {
console.error('[ErrorBoundary] 捕获到未处理的渲染错误:', error, info);
}
private backToLogin = () => {
window.location.href = '/login';
};
render() {
if (this.state.error) {
return (
<div
style={{
height: '100vh',
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
gap: 16,
padding: 24,
fontFamily: 'system-ui, sans-serif',
color: '#333',
}}
>
<h1 style={{ margin: 0, fontSize: 20 }}>页面出错了</h1>
<p style={{ maxWidth: 520, textAlign: 'center', color: '#666', lineHeight: 1.6 }}>
{this.state.error.message || '未知错误'}
</p>
<button
type="button"
onClick={this.backToLogin}
style={{
padding: '8px 20px',
border: 'none',
borderRadius: 6,
background: '#1677ff',
color: '#fff',
cursor: 'pointer',
}}
>
返回登录
</button>
</div>
);
}
return this.props.children;
}
}
import { useState } from 'react';
import { useNavigate } from 'react-router-dom';
import { App as AntdApp, Button, Form, Input } from 'antd';
import { LockOutlined, UserOutlined } from '@ant-design/icons';
import { BrandMark } from '@hm/ui';
import { useAuthStore } from '@/store/useAuthStore';
import './login.css';
interface LoginForm {
username: string;
password: string;
}
export function LoginPage() {
const navigate = useNavigate();
const { message } = AntdApp.useApp();
const login = useAuthStore((s) => s.login);
const [submitting, setSubmitting] = useState(false);
const onFinish = async (values: LoginForm) => {
setSubmitting(true);
const ok = await login(values.username, values.password);
setSubmitting(false);
if (ok) {
message.success('登录成功');
navigate('/', { replace: true });
} else {
message.error(useAuthStore.getState().error ?? '登录失败');
}
};
return (
<div className="hm-login">
<div className="hm-login__card">
<BrandMark />
<h1 className="hm-login__title">智能网联监管平台</h1>
<p className="hm-login__sub">风险热力图 · 请先登录</p>
<Form<LoginForm> layout="vertical" onFinish={onFinish} disabled={submitting}>
<Form.Item
name="username"
label="用户名"
rules={[{ required: true, message: '请输入用户名' }]}
>
<Input
prefix={<UserOutlined />}
placeholder="用户名"
autoComplete="username"
/>
</Form.Item>
<Form.Item
name="password"
label="密码"
rules={[{ required: true, message: '请输入密码' }]}
>
<Input.Password
prefix={<LockOutlined />}
placeholder="密码"
autoComplete="current-password"
/>
</Form.Item>
<Form.Item>
<Button type="primary" htmlType="submit" block loading={submitting}>
登录
</Button>
</Form.Item>
</Form>
</div>
</div>
);
}
import { type ReactNode, useEffect, useState } from 'react';
import { Navigate } from 'react-router-dom';
import { useAuthStore } from '@/store/useAuthStore';
/**
* 路由守卫:未登录跳 /login;本地有 token 但未确认(刷新后从持久化恢复)
* 时调 /api/me 续期校验,校验中先不渲染受保护内容。
*/
export function RequireAuth({ children }: { children: ReactNode }) {
const token = useAuthStore((s) => s.token);
const status = useAuthStore((s) => s.status);
const bootstrap = useAuthStore((s) => s.bootstrap);
const [checked, setChecked] = useState(false);
useEffect(() => {
if (token && status !== 'authed') {
void bootstrap().finally(() => setChecked(true));
} else {
setChecked(true);
}
}, [token, status, bootstrap]);
if (!token) return <Navigate to="/login" replace />;
if (token && !checked) return null;
return <>{children}</>;
}
.hm-login {
position: fixed;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
background: linear-gradient(135deg, #4653a2 0%, #2b3170 100%);
}
.hm-login__card {
width: 360px;
padding: 32px 28px;
background: #fff;
border-radius: 12px;
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
text-align: center;
}
.hm-login__title {
margin: 16px 0 4px;
font-size: 18px;
color: #1f1f1f;
}
.hm-login__sub {
margin: 0 0 20px;
color: rgba(0, 0, 0, 0.45);
font-size: 13px;
}
...@@ -281,8 +281,9 @@ export class HeatLayer { ...@@ -281,8 +281,9 @@ export class HeatLayer {
destroy() { destroy() {
unregisterDebugLayer('heat'); unregisterDebugLayer('heat');
// AMap JS API 2.0 的 HeatMap 运行时没有 destroy() 方法(d.ts 误声明了),
// 调用会抛 "destroy is not a function"。官方移除方式就是 setMap(null)。
this.heat?.setMap(null); this.heat?.setMap(null);
this.heat?.destroy();
this.heat = null; this.heat = null;
this.dataset = null; this.dataset = null;
this.feed = null; this.feed = null;
......
import { useEffect } from 'react'; import { useEffect } from 'react';
import { useHeatmapStore } from '@/store/useHeatmapStore'; import { useHeatmapStore } from '@/store/useHeatmapStore';
import { aggregateClient } from './aggregate/aggregateClient'; import { aggregateClient } from './aggregate/aggregateClient';
import { loadIncidents, loadMeta, whenIdle } from './data/loadData'; import { whenIdle } from './data/loadData';
import { ensureDetailLoaded, setDetailSource } from './data/detailLoader'; import { ensureDetailLoaded, setDetailSource } from './data/detailLoader';
import { ensureDistrictShapes } from './geo/districtShapes'; import { ensureDistrictShapes } from './geo/districtShapes';
import { readImportedIncidents } from './data/importedDb'; import { readImportedIncidents } from './data/importedDb';
...@@ -9,14 +9,16 @@ import { readImportedIncidents } from './data/importedDb'; ...@@ -9,14 +9,16 @@ import { readImportedIncidents } from './data/importedDb';
/** /**
* 数据装载编排。 * 数据装载编排。
* *
* 数据源有两级,导入优先: * 数据源只有一个:用户导入并持久化在 IndexedDB 的数据集(刷新后仍是「最新数据」)。
* 1) 用户导入并持久化在 IndexedDB 的数据集(刷新后仍是「最新数据」); * 没有导入数据就是「空态(EMPTY)」,由顶栏「导入数据」引导。
* 2) 本地 `pnpm data:build` 产出的 public/data/*.json(仓库不内置,仅供开发 / 测试)。
* *
* 仓库默认不携带数据:打开系统若两级都没有,则进入「空态(EMPTY)」,由顶栏「导入数据」引导。 * 为什么不再回退 `public/data/*` 示例产物(原先的第二级):
* 那条回退会让「清除导入数据 → 回到空态」变成假空态 —— clearImportedBundle()
* 刚把 IndexedDB 清掉,bootstrap 转身又把示例数据载回来,用户以为没清干净。
* 示例产物只由 `pnpm data:build` 生成,供脚本 / 离线校验用,不再参与运行时装载。
* *
* 两条路都把首屏压到最小:只需要 lng/lat/ts/区/街道 这几列就能画图, * 首屏只读 incidents 一条记录(lng/lat/ts/区/街道)就能画图,详情列
* 详情列(案件号 + 详细地址,体量最大)一律推到地图画完之后的空闲时段加载。 * (案件号 + 详细地址,体量最大)一律推到地图画完之后的空闲时段加载。
* 导入路径额外赚一笔:IDB 里存的就是二进制列,读回来直接 transfer 进聚合 Worker, * 导入路径额外赚一笔:IDB 里存的就是二进制列,读回来直接 transfer 进聚合 Worker,
* 20W 行实测 6ms(同量级 number[] 要 168ms),不用过一遍 Int32Array.from。 * 20W 行实测 6ms(同量级 number[] 要 168ms),不用过一遍 Int32Array.from。
* *
...@@ -60,41 +62,20 @@ export function useBootstrap(): void { ...@@ -60,41 +62,20 @@ export function useBootstrap(): void {
try { try {
setStatus('loading'); setStatus('loading');
// 先看有没有导入数据;有就直接用它,跳过 public 网络加载 // 只认本地导入的数据:没有就进空态,不回退 public/data 示例产物
const imported = await readImportedIncidents(); const imported = await readImportedIncidents();
if (cancelled) return; if (cancelled) return;
if (imported) { if (!imported) {
setMeta(imported.meta); setStatus('empty');
setDataOrigin('imported', imported.manifest);
setDetailSource('imported');
await aggregateClient.initFromColumns(imported.meta, imported.columns);
if (cancelled) return;
patchPerf({ loadMs: performance.now() - t0 });
setProgress(null);
setStatus('ready');
scheduleDetail();
return; return;
} }
// 回退:本地 data:build 产物(仓库不内置,仅开发 / 测试时有) setMeta(imported.meta);
setDataOrigin('sample', null); setDataOrigin('imported', imported.manifest);
setDetailSource('sample'); setDetailSource('imported');
const meta = await loadMeta((p) =>
setProgress({ file: p.file, ratio: p.total > 0 ? p.ratio : 0 }),
);
if (cancelled) return;
setMeta(meta);
const incidents = await loadIncidents((p) => await aggregateClient.initFromColumns(imported.meta, imported.columns);
setProgress({ file: p.file, ratio: p.total > 0 ? p.ratio : 0 }),
);
if (cancelled) return;
await aggregateClient.init(meta, incidents);
if (cancelled) return; if (cancelled) return;
patchPerf({ loadMs: performance.now() - t0 }); patchPerf({ loadMs: performance.now() - t0 });
...@@ -103,14 +84,12 @@ export function useBootstrap(): void { ...@@ -103,14 +84,12 @@ export function useBootstrap(): void {
scheduleDetail(); scheduleDetail();
} catch (err) { } catch (err) {
if (cancelled) return; if (cancelled) return;
// 走到这里的只可能是「导入数据存在但装载失败」(IndexedDB 读取本身已在
// readImportedIncidents 内部兜成 null → 空态),所以按真实故障提示,
// 而不是伪装成空态把问题吞掉。
const msg = err instanceof Error ? err.message : String(err); const msg = err instanceof Error ? err.message : String(err);
// 离线产物缺失(data 文件不存在 / meta.json 404 / 网络错)视为「无数据」,引导走导入; setProgress(null);
// 项目默认不内置数据,空态是预期常态,不是故障。 setStatus('error', msg);
const isMissing =
/数据文件不存在/.test(msg) ||
(/meta\.json/.test(msg) && /(404|Failed to fetch|NetworkError)/.test(msg));
if (isMissing) setStatus('empty');
else setStatus('error', msg);
} }
})(); })();
......
import { type CSSProperties, type ReactNode } from 'react'; import { type CSSProperties, type ReactNode } from 'react';
import { Button, Tooltip } from 'antd'; import { useNavigate } from 'react-router-dom';
import { Avatar, Button, Dropdown, Tooltip } from 'antd';
import { BrandMark } from '@hm/ui'; import { BrandMark } from '@hm/ui';
import { useHeatmapStore } from '@/store/useHeatmapStore'; import { useHeatmapStore } from '@/store/useHeatmapStore';
import { useAuthStore } from '@/store/useAuthStore';
import { useFullscreen } from '@/layout/useFullscreen'; import { useFullscreen } from '@/layout/useFullscreen';
import { ImportControl } from '@/layout/ImportControl'; import { ImportControl } from '@/layout/ImportControl';
import type { MetaFile } from '@/features/heatmap/aggregate/types'; import type { MetaFile } from '@/features/heatmap/aggregate/types';
...@@ -13,6 +15,8 @@ import { ...@@ -13,6 +15,8 @@ import {
DatabaseOutlined, DatabaseOutlined,
FullscreenExitOutlined, FullscreenExitOutlined,
FullscreenOutlined, FullscreenOutlined,
LogoutOutlined,
UserOutlined,
} from '@ant-design/icons'; } from '@ant-design/icons';
function Pill({ function Pill({
...@@ -185,6 +189,9 @@ export function HeaderBar() { ...@@ -185,6 +189,9 @@ export function HeaderBar() {
const importInfo = useHeatmapStore((s) => s.importInfo); const importInfo = useHeatmapStore((s) => s.importInfo);
const coverage = meta ? spanDays(meta.timeRange.min, meta.timeRange.max) : 0; const coverage = meta ? spanDays(meta.timeRange.min, meta.timeRange.max) : 0;
const { active: isFs, toggle: toggleFs } = useFullscreen(); const { active: isFs, toggle: toggleFs } = useFullscreen();
const username = useAuthStore((s) => s.user?.username);
const logout = useAuthStore((s) => s.logout);
const navigate = useNavigate();
/** /**
* 数字是从哪份数据来的,写在悬浮里。 * 数字是从哪份数据来的,写在悬浮里。
...@@ -204,22 +211,12 @@ export function HeaderBar() { ...@@ -204,22 +211,12 @@ export function HeaderBar() {
if (dataOrigin === 'imported') { if (dataOrigin === 'imported') {
return buildImportTip(meta, importInfo); return buildImportTip(meta, importInfo);
} }
// 未导入:项目不内置数据,非导入态即空态(请走顶栏导入) // 空态时 meta 为 null(上面已提前 return),这里只兜一句「未导入」;
if (status === 'empty') { // 不再有「本地 data:build 产物(public/data)」这种已废弃的示例数据说法。
return (
<div style={TIP_STYLE}>
<div>尚未导入数据</div>
<div style={{ marginTop: 2, opacity: 0.75 }}>请通过顶栏「导入数据」选择本地 xlsx / csv</div>
{note}
</div>
);
}
return ( return (
<div style={TIP_STYLE}> <div style={TIP_STYLE}>
<div>本地 data:build 产物(public/data)</div> <div>尚未导入数据</div>
<div style={{ marginTop: 2 }}> <div style={{ marginTop: 2, opacity: 0.75 }}>请通过顶栏「导入数据」选择本地 xlsx / csv</div>
有效 <b>{fmtInt(meta.count)}</b> 条
</div>
{note} {note}
</div> </div>
); );
...@@ -257,7 +254,7 @@ export function HeaderBar() { ...@@ -257,7 +254,7 @@ export function HeaderBar() {
<div className="hm-header__right"> <div className="hm-header__right">
<Pill <Pill
icon={<DatabaseOutlined />} icon={<DatabaseOutlined />}
label={dataOrigin === 'imported' ? '导入' : '样本'} label={dataOrigin === 'imported' ? '导入' : '未导入'}
value={meta ? fmtCompact(meta.count) : '—'} value={meta ? fmtCompact(meta.count) : '—'}
tip={sourceTip} tip={sourceTip}
/> />
...@@ -269,6 +266,29 @@ export function HeaderBar() { ...@@ -269,6 +266,29 @@ export function HeaderBar() {
/> />
<Pill icon={<AppstoreOutlined />} label="状态" value={statusText} /> <Pill icon={<AppstoreOutlined />} label="状态" value={statusText} />
<ImportControl /> <ImportControl />
{username && (
<Dropdown
menu={{
items: [{ key: 'logout', icon: <LogoutOutlined />, label: '退出登录' }],
onClick: async ({ key }) => {
if (key === 'logout') {
// 退出后主动跳转,不依赖路由守卫的被动重定向(SPA 内被动 Navigate 在你的环境偶发不生效)
await logout();
navigate('/login', { replace: true });
}
},
}}
>
<Button
type="text"
className="hm-header__icon-btn"
style={{ display: 'inline-flex', alignItems: 'center', gap: 6 }}
>
<Avatar size="small" icon={<UserOutlined />} />
{username}
</Button>
</Dropdown>
)}
<Tooltip title={isFs ? '退出全屏 (F / Esc)' : '一键全屏 (F)'}> <Tooltip title={isFs ? '退出全屏 (F / Esc)' : '一键全屏 (F)'}>
<Button <Button
type="text" type="text"
......
...@@ -178,7 +178,12 @@ export function ImportControl() { ...@@ -178,7 +178,12 @@ export function ImportControl() {
} }
} }
async function restoreSample() { /**
* 清掉本地导入数据并整页重载。
* IndexedDB 清空后 useBootstrap 读不到任何数据集 → 进入真空态(EMPTY),
* 不再回退 public/data 示例产物,所以「回到空态」是真的空。
*/
async function clearImport() {
try { try {
await clearImportedBundle(); await clearImportedBundle();
await reload(); await reload();
...@@ -197,7 +202,7 @@ export function ImportControl() { ...@@ -197,7 +202,7 @@ export function ImportControl() {
type="text" type="text"
className="hm-header__icon-btn" className="hm-header__icon-btn"
icon={<RollbackOutlined />} icon={<RollbackOutlined />}
onClick={restoreSample} onClick={clearImport}
/> />
</Tooltip> </Tooltip>
)} )}
......
import { StrictMode } from 'react'; import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client'; import { createRoot } from 'react-dom/client';
import { App as AntdApp, ConfigProvider } from 'antd';
import zhCN from 'antd/locale/zh_CN';
import { BrowserRouter, Routes, Route } from 'react-router-dom';
import { themeConfig } from '@/theme/themeConfig';
import App from './App'; import App from './App';
import { LoginPage } from '@/features/auth/LoginPage';
import { RequireAuth } from '@/features/auth/RequireAuth';
import { ErrorBoundary } from './ErrorBoundary';
const el = document.getElementById('root'); const el = document.getElementById('root');
if (!el) throw new Error('未找到 #root 挂载点'); if (!el) throw new Error('未找到 #root 挂载点');
createRoot(el).render( createRoot(el).render(
<StrictMode> <StrictMode>
<App /> <ConfigProvider locale={zhCN} theme={themeConfig}>
<AntdApp>
<ErrorBoundary>
<BrowserRouter>
<Routes>
<Route path="/login" element={<LoginPage />} />
<Route
path="/*"
element={
<RequireAuth>
<App />
</RequireAuth>
}
/>
</Routes>
</BrowserRouter>
</ErrorBoundary>
</AntdApp>
</ConfigProvider>
</StrictMode>, </StrictMode>,
); );
import { create } from 'zustand';
import { persist } from 'zustand/middleware';
export interface AuthUser {
username: string;
}
interface AuthState {
token: string | null;
user: AuthUser | null;
status: 'idle' | 'loading' | 'authed' | 'error';
error: string | null;
login: (username: string, password: string) => Promise<boolean>;
logout: () => Promise<void>;
/** 启动续期:用本地 token 调 /api/me 校验,失效则清态 */
bootstrap: () => Promise<void>;
}
export const useAuthStore = create<AuthState>()(
persist(
(set, get) => ({
token: null,
user: null,
status: 'idle',
error: null,
async login(username, password) {
set({ status: 'loading', error: null });
try {
const res = await fetch('/api/login', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ username, password }),
});
if (!res.ok) {
set({ status: 'error', error: '用户名或密码错误' });
return false;
}
const data = (await res.json()) as { token: string; user: AuthUser };
set({ token: data.token, user: data.user, status: 'authed', error: null });
return true;
} catch {
set({ status: 'error', error: '登录服务不可用,请确认后台已启动' });
return false;
}
},
async logout() {
const token = get().token;
if (token) {
// 无状态 JWT:后端不留存会话,调一下仅作语义清晰,失败不阻塞前端清态
try {
await fetch('/api/logout', {
method: 'POST',
headers: { Authorization: `Bearer ${token}` },
});
} catch {
/* ignore */
}
}
set({ token: null, user: null, status: 'idle', error: null });
},
async bootstrap() {
const token = get().token;
if (!token) return;
try {
const res = await fetch('/api/me', {
headers: { Authorization: `Bearer ${token}` },
});
if (res.ok) {
const data = (await res.json()) as { user: AuthUser };
set({ user: data.user, status: 'authed' });
} else {
// token 失效(过期 / 伪造):清掉,回到未登录
set({ token: null, user: null, status: 'idle' });
}
} catch {
// 网络错先保留本地 token,下次启动再续期,不强制登出
}
},
}),
{
name: 'hm-auth',
// 只持久化凭证,状态机字段不入库
partialize: (s) => ({ token: s.token, user: s.user }),
},
),
);
...@@ -379,9 +379,9 @@ interface HeatmapState { ...@@ -379,9 +379,9 @@ interface HeatmapState {
detailReady: boolean; detailReady: boolean;
/** 高德 Key 未配置 / 加载失败时的引导信息 */ /** 高德 Key 未配置 / 加载失败时的引导信息 */
amapError: { code: string; message: string; hint: string } | null; amapError: { code: string; message: string; hint: string } | null;
/** 当前数据来源:内置示例 or 用户导入(持久化在 IndexedDB) */ /** 当前数据来源:用户导入(持久化在 IndexedDB)or 空态(本地无任何数据集) */
dataOrigin: 'sample' | 'imported'; dataOrigin: 'empty' | 'imported';
/** 导入数据集的清单,供顶栏展示「导入自 xxx.xlsx」与恢复示例入口 */ /** 导入数据集的清单,供顶栏展示「导入自 xxx.xlsx」与清除导入入口 */
importInfo: ImportManifest | null; importInfo: ImportManifest | null;
/* 筛选 */ /* 筛选 */
...@@ -641,7 +641,7 @@ export const useHeatmapStore = create<HeatmapState>((set, get) => ({ ...@@ -641,7 +641,7 @@ export const useHeatmapStore = create<HeatmapState>((set, get) => ({
meta: null, meta: null,
detailReady: false, detailReady: false,
amapError: null, amapError: null,
dataOrigin: 'sample', dataOrigin: 'empty',
importInfo: null, importInfo: null,
filter: emptyFilter(), filter: emptyFilter(),
......
...@@ -60,6 +60,14 @@ export default defineConfig({ ...@@ -60,6 +60,14 @@ export default defineConfig({
// 与 uj-store 的 5173 错开,两个项目可同时起 // 与 uj-store 的 5173 错开,两个项目可同时起
port: 5174, port: 5174,
strictPort: false, strictPort: false,
// 登录后台服务(packages/server,默认 8787)同源接入:dev 下把 /api 透传过去,
// 前端无需关心端口、也避开 CORS;生产由 Nginx 同源反代到 Node 进程
proxy: {
'/api': {
target: 'http://localhost:8787',
changeOrigin: true,
},
},
}, },
build: { build: {
// 高德 JS API 是外链 script,不进 bundle;但 react/antd 体积可观,拆开便于并行下载 // 高德 JS API 是外链 script,不进 bundle;但 react/antd 体积可观,拆开便于并行下载
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!