首次提交:脑晴测 H5 项目
包含前端源码、预构建产物(dist/)、零依赖 Node.js 服务器(server.mjs)、 Cloudflare Worker 版本(worker/)、部署文档(DEPLOY.md)和交接文档。 技术总监可直接 clone 后运行 node server.mjs 启动,无需安装 React 或 build。 DEEPSEEK_API_KEY 通过环境变量注入,未纳入仓库。
This commit is contained in:
48
brain-h5/scripts/update-mobile-runtime-lock.mjs
Normal file
48
brain-h5/scripts/update-mobile-runtime-lock.mjs
Normal file
@@ -0,0 +1,48 @@
|
||||
#!/usr/bin/env node
|
||||
import { createHash } from "node:crypto";
|
||||
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
||||
const lockPath = path.join(root, "mobile-runtime.lock.json");
|
||||
const protectedFiles = [
|
||||
"scripts/check-mobile-runtime.mjs",
|
||||
"scripts/prepare-sites-build.mjs",
|
||||
"scripts/update-mobile-runtime-lock.mjs",
|
||||
"vite.config.ts",
|
||||
"src/App.tsx",
|
||||
"src/main.tsx",
|
||||
"src/styles.css",
|
||||
"src/mobile/BottomSheet.tsx",
|
||||
"src/mobile/Carousel.tsx",
|
||||
"src/mobile/Device.tsx",
|
||||
"src/mobile/FlowStack.tsx",
|
||||
"src/mobile/Keyboard.tsx",
|
||||
"src/mobile/MobileCursor.tsx",
|
||||
"src/mobile/MobileRuntime.tsx",
|
||||
"src/mobile/MobileScroll.tsx",
|
||||
"src/mobile/PhoneFrame.tsx",
|
||||
"src/mobile/assets.ts",
|
||||
"src/mobile/components.tsx",
|
||||
"src/mobile/geometry.ts",
|
||||
"src/mobile/index.ts",
|
||||
"public/assets/iphone/Bezel.png",
|
||||
"public/assets/iphone/Keyboard.png",
|
||||
"public/assets/android/Pixel10.png",
|
||||
"public/assets/android/Keyboard.png",
|
||||
"public/assets/android/navigation-bar.svg",
|
||||
"public/assets/status/status-icons.svg",
|
||||
"public/assets/status/ios-status-icons.svg",
|
||||
"worker/index.js",
|
||||
];
|
||||
|
||||
const hashes = {};
|
||||
for (const relativePath of protectedFiles) {
|
||||
const filePath = path.join(root, relativePath);
|
||||
if (!existsSync(filePath)) throw new Error(`Protected runtime file is missing: ${relativePath}`);
|
||||
hashes[relativePath] = createHash("sha256").update(readFileSync(filePath)).digest("hex");
|
||||
}
|
||||
|
||||
writeFileSync(lockPath, `${JSON.stringify(hashes, null, 2)}\n`);
|
||||
console.log(`Updated mobile-runtime.lock.json (${protectedFiles.length} protected files).`);
|
||||
Reference in New Issue
Block a user