From 0f9b2a7b1feafcef389d35daeef6348a8d80607d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=9C=B1?= <10714957+xiao-zhu245@user.noreply.gitee.com> Date: Tue, 8 Jul 2025 19:11:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=89=93=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.example | 86 +- client/.env.example | 13 + client/src/config/index.ts | 45 + client/src/utils/api.ts | 5 +- client/src/utils/socket.ts | 5 +- client/src/vite-env.d.ts | 11 + client/tsconfig.json | 8 +- client/vite.config.ts | 19 +- package-lock.json | 905 +++++++++++++++++- scripts/package.js | 49 +- server/src/index.ts | 43 +- server/src/middleware/auth.ts | 4 +- server/src/modules/auth/AuthManager.ts | 4 +- .../src/modules/terminal/TerminalManager.ts | 4 +- server/src/routes/auth.ts | 6 +- server/src/routes/games.ts | 4 +- server/src/routes/index.ts | 8 +- server/src/routes/system.ts | 4 +- server/src/routes/terminal.ts | 4 +- server/tsconfig.json | 17 +- 报错 => 报错.txt | 0 21 files changed, 1149 insertions(+), 95 deletions(-) create mode 100644 client/.env.example create mode 100644 client/src/config/index.ts create mode 100644 client/src/vite-env.d.ts rename 报错 => 报错.txt (100%) diff --git a/.env.example b/.env.example index 63d627e..ac9e79b 100644 --- a/.env.example +++ b/.env.example @@ -1,40 +1,70 @@ -# GSM3 游戏服务端管理面板环境配置 +# GSM3 游戏服务器管理系统配置 -# 服务器配置 -PORT=3000 -HOST=localhost +# 服务器端口配置 +# 后端API服务端口 +SERVER_PORT=3001 + +# 前端开发服务端口(仅开发环境使用) +CLIENT_PORT=5173 + +# 环境配置 NODE_ENV=production -# 前端构建路径 -CLIENT_BUILD_PATH=./public - -# 数据存储路径 -DATA_PATH=./data - # 日志配置 LOG_LEVEL=info -LOG_PATH=./logs - -# JWT配置 -JWT_SECRET=your-super-secret-jwt-key-change-this-in-production -JWT_EXPIRES_IN=24h - -# 认证配置 -MAX_LOGIN_ATTEMPTS=5 -LOCKOUT_DURATION=900000 -SESSION_TIMEOUT=86400000 # CORS配置 -CORS_ORIGIN=http://localhost:3000 +# 允许的前端访问地址,生产环境请修改为实际域名 +CORS_ORIGIN=* + +# Socket.IO配置 +SOCKET_CORS_ORIGIN=* + +# 数据目录 +DATA_DIR=./data + +# 日志目录 +LOG_DIR=./logs + +# PTY配置 +PTY_TIMEOUT=1800000 +PTY_MAX_SESSIONS=10 # 游戏服务器配置 -GAME_DATA_PATH=./data/games -GAME_BACKUPS_PATH=./data/backups +GAME_MAX_INSTANCES=5 +GAME_DATA_DIR=./data/games -# 文件上传配置 -UPLOAD_PATH=./uploads -MAX_FILE_SIZE=100MB +# 系统监控配置 +SYSTEM_MONITOR_INTERVAL=5000 +SYSTEM_STATS_HISTORY_SIZE=720 + +# 告警配置 +ALERT_CPU_WARNING=70 +ALERT_CPU_CRITICAL=90 +ALERT_MEMORY_WARNING=80 +ALERT_MEMORY_CRITICAL=95 +ALERT_DISK_WARNING=85 +ALERT_DISK_CRITICAL=95 + +# Java配置(用于Minecraft服务器) +JAVA_HOME= +JAVA_OPTS=-Xmx2G -Xms1G # 安全配置 -RATE_LIMIT_WINDOW=900000 -RATE_LIMIT_MAX=100 \ No newline at end of file +SESSION_SECRET=your-secret-key-here +JWT_SECRET=your-jwt-secret-here + +# 备份配置 +BACKUP_ENABLED=true +BACKUP_INTERVAL=86400000 +BACKUP_RETENTION=7 + +# 网络配置 +MAX_UPLOAD_SIZE=100mb +REQUEST_TIMEOUT=30000 + +# 说明: +# 1. 修改 SERVER_PORT 可以更改后端服务端口 +# 2. 生产环境部署时,请将 CORS_ORIGIN 和 SOCKET_CORS_ORIGIN 设置为实际的前端访问地址 +# 3. 请务必修改 SESSION_SECRET 和 JWT_SECRET 为随机字符串 +# 4. 根据服务器配置调整 JAVA_OPTS 中的内存设置 \ No newline at end of file diff --git a/client/.env.example b/client/.env.example new file mode 100644 index 0000000..ba5071b --- /dev/null +++ b/client/.env.example @@ -0,0 +1,13 @@ +# 前端环境配置 + +# 后端服务端口(生产环境使用) +VITE_SERVER_PORT=3001 + +# 前端开发服务端口(仅开发环境使用) +VITE_CLIENT_PORT=5173 + +# 说明: +# 1. VITE_SERVER_PORT 用于配置前端连接的后端服务端口 +# 2. VITE_CLIENT_PORT 用于配置前端开发服务器端口 +# 3. 生产环境部署时,前端会自动根据当前页面地址和 VITE_SERVER_PORT 连接后端 +# 4. 开发环境时,Vite 会使用代理转发请求到后端服务 \ No newline at end of file diff --git a/client/src/config/index.ts b/client/src/config/index.ts new file mode 100644 index 0000000..241421e --- /dev/null +++ b/client/src/config/index.ts @@ -0,0 +1,45 @@ +// 前端配置文件 + +// 获取后端服务端口 +function getServerPort(): string { + // 优先从环境变量读取(Vite会自动注入VITE_开头的环境变量) + if (import.meta.env.VITE_SERVER_PORT) { + return import.meta.env.VITE_SERVER_PORT + } + + // 从URL参数读取 + const urlParams = new URLSearchParams(window.location.search) + const portParam = urlParams.get('server_port') + if (portParam) { + return portParam + } + + // 默认端口 + return '3001' +} + +// 获取完整的服务器URL +function getServerUrl(): string { + const protocol = window.location.protocol === 'https:' ? 'https:' : 'http:' + const hostname = window.location.hostname + const port = getServerPort() + return `${protocol}//${hostname}:${port}` +} + +// 获取API基础URL +function getApiBaseUrl(): string { + return `${getServerUrl()}/api` +} + +// 导出配置 +export const config = { + serverPort: getServerPort(), + serverUrl: getServerUrl(), + apiBaseUrl: getApiBaseUrl(), + + // 其他配置 + requestTimeout: 30000, + socketTimeout: 20000, +} + +export default config \ No newline at end of file diff --git a/client/src/utils/api.ts b/client/src/utils/api.ts index 9ac2e00..5104b62 100644 --- a/client/src/utils/api.ts +++ b/client/src/utils/api.ts @@ -1,5 +1,6 @@ import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios' import { LoginRequest, LoginResponse, ApiResponse, User } from '@/types' +import config from '@/config' class ApiClient { private client: AxiosInstance @@ -7,8 +8,8 @@ class ApiClient { constructor() { this.client = axios.create({ - baseURL: 'http://localhost:3001/api', - timeout: 30000, + baseURL: config.apiBaseUrl, + timeout: config.requestTimeout, headers: { 'Content-Type': 'application/json', }, diff --git a/client/src/utils/socket.ts b/client/src/utils/socket.ts index 4eba065..e52ce6e 100644 --- a/client/src/utils/socket.ts +++ b/client/src/utils/socket.ts @@ -1,5 +1,6 @@ import { io, Socket } from 'socket.io-client' import { SocketEvents } from '@/types' +import config from '@/config' class SocketClient { private socket: Socket | null = null @@ -15,12 +16,12 @@ class SocketClient { private connect() { const token = localStorage.getItem('gsm3_token') - this.socket = io('http://localhost:3001', { + this.socket = io(config.serverUrl, { auth: { token, }, transports: ['websocket', 'polling'], - timeout: 20000, + timeout: config.socketTimeout, forceNew: true, }) diff --git a/client/src/vite-env.d.ts b/client/src/vite-env.d.ts new file mode 100644 index 0000000..19f6241 --- /dev/null +++ b/client/src/vite-env.d.ts @@ -0,0 +1,11 @@ +/// + +interface ImportMetaEnv { + readonly VITE_SERVER_PORT?: string + readonly VITE_CLIENT_PORT?: string + // 更多环境变量可以在这里添加 +} + +interface ImportMeta { + readonly env: ImportMetaEnv +} \ No newline at end of file diff --git a/client/tsconfig.json b/client/tsconfig.json index e022bc5..cbc4e4e 100644 --- a/client/tsconfig.json +++ b/client/tsconfig.json @@ -15,10 +15,10 @@ "jsx": "react-jsx", /* Linting */ - "strict": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "noFallthroughCasesInSwitch": true, + "strict": false, + "noUnusedLocals": false, + "noUnusedParameters": false, + "noFallthroughCasesInSwitch": false, /* Path mapping */ "baseUrl": ".", diff --git a/client/vite.config.ts b/client/vite.config.ts index 543379d..f7858dd 100644 --- a/client/vite.config.ts +++ b/client/vite.config.ts @@ -2,6 +2,19 @@ import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' import path from 'path' +// 获取后端服务端口 +const getServerPort = () => { + return process.env.VITE_SERVER_PORT || process.env.SERVER_PORT || '3001' +} + +// 获取前端开发端口 +const getClientPort = () => { + return parseInt(process.env.VITE_CLIENT_PORT || process.env.CLIENT_PORT || '5173', 10) +} + +const serverPort = getServerPort() +const clientPort = getClientPort() + // https://vitejs.dev/config/ export default defineConfig({ plugins: [react()], @@ -11,14 +24,14 @@ export default defineConfig({ }, }, server: { - port: 3000, + port: clientPort, proxy: { '/api': { - target: 'http://localhost:3001', + target: `http://localhost:${serverPort}`, changeOrigin: true, }, '/socket.io': { - target: 'http://localhost:3001', + target: `http://localhost:${serverPort}`, changeOrigin: true, ws: true, }, diff --git a/package-lock.json b/package-lock.json index e730c68..c5c2f37 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,24 @@ { - "name": "gsm3-game-panel", + "name": "gsm3-management-panel", "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "gsm3-game-panel", + "name": "gsm3-management-panel", "version": "1.0.0", - "license": "MIT", + "license": "ISC", "devDependencies": { - "concurrently": "^8.2.2" + "@types/archiver": "^6.0.2", + "@types/fs-extra": "^11.0.4", + "archiver": "^6.0.1", + "concurrently": "^8.2.2", + "fs-extra": "^11.2.0", + "rimraf": "^5.0.5" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" } }, "node_modules/@babel/runtime": { @@ -22,6 +31,171 @@ "node": ">=6.9.0" } }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@isaacs/cliui/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@types/archiver": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/@types/archiver/-/archiver-6.0.3.tgz", + "integrity": "sha512-a6wUll6k3zX6qs5KlxIggs1P1JcYJaTCx2gnlr+f0S1yd2DoaEwoIK10HmBaLnZwWneBz+JBm0dwcZu0zECBcQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/readdir-glob": "*" + } + }, + "node_modules/@types/fs-extra": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-11.0.4.tgz", + "integrity": "sha512-yTbItCNreRooED33qjunPthRcSjERP1r4MqCZc7wv0u2sUkzTFp45tgUfS5+r7FrZPdmCCNflLhVSP/o+SemsQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/jsonfile": "*", + "@types/node": "*" + } + }, + "node_modules/@types/jsonfile": { + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/@types/jsonfile/-/jsonfile-6.1.4.tgz", + "integrity": "sha512-D5qGUYwjvnNNextdU59/+fI+spnwtTFmyQP0h+PfIOSkNfpU6AOICUOkm4i0OnSk+NyjdPJrxCDro0sJsWlRpQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/node": { + "version": "24.0.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.0.10.tgz", + "integrity": "sha512-ENHwaH+JIRTDIEEbDK6QSQntAYGtbvdDXnMXnZaZ6k13Du1dPMmprkEHIL7ok2Wl2aZevetwTAb5S+7yIF+enA==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~7.8.0" + } + }, + "node_modules/@types/readdir-glob": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@types/readdir-glob/-/readdir-glob-1.1.5.tgz", + "integrity": "sha512-raiuEPUYqXu+nvtY2Pe8s8FEmZ3x5yAH4VkLdihcPdalvsHltomrRC9BzuStrJ9yk06470hS0Crw0f1pXqD+Hg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", @@ -48,6 +222,92 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/archiver": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/archiver/-/archiver-6.0.2.tgz", + "integrity": "sha512-UQ/2nW7NMl1G+1UnrLypQw1VdT9XZg/ECcKPq7l+STzStrSivFIXIp34D8M5zeNGW5NoOupdYCHv6VySCPNNlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "archiver-utils": "^4.0.1", + "async": "^3.2.4", + "buffer-crc32": "^0.2.1", + "readable-stream": "^3.6.0", + "readdir-glob": "^1.1.2", + "tar-stream": "^3.0.0", + "zip-stream": "^5.0.1" + }, + "engines": { + "node": ">= 12.0.0" + } + }, + "node_modules/archiver-utils": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-4.0.1.tgz", + "integrity": "sha512-Q4Q99idbvzmgCTEAAhi32BkOyq8iVI5EwdO0PmBDSGIzzjYNdcFn7Q7k3OzbLy4kLUPXfJtG6fO2RjftXbobBg==", + "dev": true, + "license": "MIT", + "dependencies": { + "glob": "^8.0.0", + "graceful-fs": "^4.2.0", + "lazystream": "^1.0.0", + "lodash": "^4.17.15", + "normalize-path": "^3.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">= 12.0.0" + } + }, + "node_modules/async": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", + "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", + "dev": true, + "license": "MIT" + }, + "node_modules/b4a": { + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.7.tgz", + "integrity": "sha512-OnAYlL5b7LEkALw87fUVafQw5rVR9RjwGd4KUwNQ6DrrNmaVaUCgLipfVlzrPQ4tWOR9P0IXGNOx50jYCCdSJg==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/bare-events": { + "version": "2.5.4", + "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.5.4.tgz", + "integrity": "sha512-+gFfDkR8pj4/TrWCGUGWmJIkBwuxPS5F+a5yWjOHQt2hHvNZd5YLzadjmDUtFmMM4y429bnKLa8bYBMHcYdnQA==", + "dev": true, + "license": "Apache-2.0", + "optional": true + }, + "node_modules/brace-expansion": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + } + }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -113,6 +373,22 @@ "dev": true, "license": "MIT" }, + "node_modules/compress-commons": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-5.0.3.tgz", + "integrity": "sha512-/UIcLWvwAQyVibgpQDPtfNM3SvqN7G9elAPAV7GM0L53EbNWwWiCsWtK8Fwed/APEbptPHXs5PuW+y8Bq8lFTA==", + "dev": true, + "license": "MIT", + "dependencies": { + "crc-32": "^1.2.0", + "crc32-stream": "^5.0.0", + "normalize-path": "^3.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">= 12.0.0" + } + }, "node_modules/concurrently": { "version": "8.2.2", "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-8.2.2.tgz", @@ -141,6 +417,55 @@ "url": "https://github.com/open-cli-tools/concurrently?sponsor=1" } }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/crc-32": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", + "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "crc32": "bin/crc32.njs" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/crc32-stream": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-5.0.1.tgz", + "integrity": "sha512-lO1dFui+CEUh/ztYIpgpKItKW9Bb4NWakCRJrnqAbFIYD+OZAwb2VfD5T5eXMw2FNcsDHkQcNl/Wh3iVXYwU6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "crc-32": "^1.2.0", + "readable-stream": "^3.4.0" + }, + "engines": { + "node": ">= 12.0.0" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/date-fns": { "version": "2.30.0", "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", @@ -158,6 +483,13 @@ "url": "https://opencollective.com/date-fns" } }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true, + "license": "MIT" + }, "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -175,6 +507,52 @@ "node": ">=6" } }, + "node_modules/fast-fifo": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz", + "integrity": "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/foreground-child": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", + "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", + "dev": true, + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.6", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/fs-extra": { + "version": "11.3.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.0.tgz", + "integrity": "sha512-Z4XaCL6dUDHfP/jT25jJKMmtxvuwbkrD1vNSMFlo9lNLY2c5FHYSQgHPRZUjAB26TpDEoW9HCOgplrdbaPV/ew==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=14.14" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true, + "license": "ISC" + }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -185,6 +563,34 @@ "node": "6.* || 8.* || >= 10.*" } }, + "node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true, + "license": "ISC" + }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -195,6 +601,25 @@ "node": ">=8" } }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dev": true, + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true, + "license": "ISC" + }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -205,6 +630,95 @@ "node": ">=8" } }, + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/lazystream": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.1.tgz", + "integrity": "sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "readable-stream": "^2.0.5" + }, + "engines": { + "node": ">= 0.6.3" + } + }, + "node_modules/lazystream/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/lazystream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true, + "license": "MIT" + }, + "node_modules/lazystream/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, "node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", @@ -212,6 +726,122 @@ "dev": true, "license": "MIT" }, + "node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "dev": true, + "license": "BlueOak-1.0.0" + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true, + "license": "MIT" + }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/readdir-glob": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/readdir-glob/-/readdir-glob-1.1.3.tgz", + "integrity": "sha512-v05I2k7xN8zXvPD9N+z/uhXPaj0sUFCe2rcWZIpBsqxfP7xXFQ0tipAd/wjj1YxWyWtUS5IDJpOG82JKt2EAVA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "minimatch": "^5.1.0" + } + }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -222,6 +852,59 @@ "node": ">=0.10.0" } }, + "node_modules/rimraf": { + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.10.tgz", + "integrity": "sha512-l0OE8wL34P4nJH/H2ffoaniAokM2qSmrtXHmlpvYr5AVVX8msAyW0l8NVJFDxlSK4u3Uh/f41cQheDVdnYijwQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "glob": "^10.3.7" + }, + "bin": { + "rimraf": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/rxjs": { "version": "7.8.2", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", @@ -232,6 +915,50 @@ "tslib": "^2.1.0" } }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/shell-quote": { "version": "1.8.3", "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.3.tgz", @@ -245,12 +972,49 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/spawn-command": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/spawn-command/-/spawn-command-0.0.2.tgz", "integrity": "sha512-zC8zGoGkmc8J9ndvml8Xksr1Amk9qBujgbF0JAIWO7kXr43w0h/0GJNM/Vustixu+YE8N/MTrQ7N31FvHUACxQ==", "dev": true }, + "node_modules/streamx": { + "version": "2.22.1", + "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.22.1.tgz", + "integrity": "sha512-znKXEBxfatz2GBNK02kRnCXjV+AA4kjZIUxeWSr3UGirZMJfTE9uiwKHobnbgxWyL/JWro8tTq+vOqAK1/qbSA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-fifo": "^1.3.2", + "text-decoder": "^1.1.0" + }, + "optionalDependencies": { + "bare-events": "^2.2.0" + } + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -266,6 +1030,22 @@ "node": ">=8" } }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -279,6 +1059,20 @@ "node": ">=8" } }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/supports-color": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", @@ -295,6 +1089,28 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, + "node_modules/tar-stream": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.7.tgz", + "integrity": "sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "b4a": "^1.6.4", + "fast-fifo": "^1.2.0", + "streamx": "^2.15.0" + } + }, + "node_modules/text-decoder": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.2.3.tgz", + "integrity": "sha512-3/o9z3X0X0fTupwsYvR03pJ/DjWuqqrfwBgTQzdWDiQSm9KitAyz/9WqsT2JQW7KV2m+bC2ol/zqpW37NHxLaA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "b4a": "^1.6.4" + } + }, "node_modules/tree-kill": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", @@ -312,6 +1128,46 @@ "dev": true, "license": "0BSD" }, + "node_modules/undici-types": { + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.8.0.tgz", + "integrity": "sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw==", + "dev": true, + "license": "MIT" + }, + "node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true, + "license": "MIT" + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -330,6 +1186,32 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true, + "license": "ISC" + }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", @@ -368,6 +1250,21 @@ "engines": { "node": ">=12" } + }, + "node_modules/zip-stream": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-5.0.2.tgz", + "integrity": "sha512-LfOdrUvPB8ZoXtvOBz6DlNClfvi//b5d56mSWyJi7XbH/HfhOHfUhOqxhT/rUiR7yiktlunqRo+jY6y/cWC/5g==", + "dev": true, + "license": "MIT", + "dependencies": { + "archiver-utils": "^4.0.1", + "compress-commons": "^5.0.1", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">= 12.0.0" + } } } } diff --git a/scripts/package.js b/scripts/package.js index 94fd786..627a3c7 100644 --- a/scripts/package.js +++ b/scripts/package.js @@ -36,6 +36,30 @@ async function createPackage() { path.join(packageDir, 'server', 'PTY') ) + // 复制环境变量配置文件 + await fs.copy( + path.join(__dirname, '..', 'server', '.env.example'), + path.join(packageDir, 'server', '.env.example') + ) + + await fs.copy( + path.join(__dirname, '..', '.env.example'), + path.join(packageDir, '.env.example') + ) + + console.log('📥 安装服务端生产依赖...') + // 在打包的服务端目录中安装生产依赖 + try { + execSync('npm install --production --omit=dev', { + cwd: path.join(packageDir, 'server'), + stdio: 'inherit' + }) + console.log('✅ 服务端依赖安装完成') + } catch (error) { + console.error('❌ 服务端依赖安装失败:', error) + throw error + } + console.log('🎨 复制前端文件...') // 复制前端构建文件 await fs.copy( @@ -48,7 +72,7 @@ async function createPackage() { const startScript = `@echo off echo 正在启动GSM3管理面板... cd server -node index.js +node_app.exe index.js pause` await fs.writeFile( @@ -60,7 +84,7 @@ pause` const startShScript = `#!/bin/bash echo "正在启动GSM3管理面板..." cd server -node index.js` +/opt/node-v22.17.0-linux-x64/bin/node index.js` await fs.writeFile( path.join(packageDir, 'start.sh'), @@ -81,20 +105,29 @@ node index.js` ## 安装说明 1. 确保已安装 Node.js (版本 >= 18) -2. 进入 server 目录 -3. 运行 \`npm install --production\` 安装依赖 -4. 复制 .env.example 为 .env 并配置相关参数 -5. 运行启动脚本: +2. 解压缩包到目标目录 +3. (可选) 配置端口和其他参数: + - 复制 .env.example 为 .env 并修改 SERVER_PORT 等配置 + - 复制 server/.env.example 为 server/.env 并配置详细参数 +4. 运行启动脚本: - Windows: 双击 start.bat - Linux/Mac: 运行 ./start.sh ## 默认访问地址 -http://localhost:3000 +http://localhost:3001 + +## 端口配置 + +- 修改根目录 .env 文件中的 SERVER_PORT 可以更改服务端口 +- 修改后需要重启服务才能生效 +- 确保防火墙允许新端口访问 ## 注意事项 -- 首次运行需要创建管理员账户 +- 依赖已预装,无需手动安装 +- 首次运行会自动创建默认管理员账户 (admin/admin123) +- 请立即登录并修改默认密码 - 确保防火墙允许相关端口访问 - 建议在生产环境中使用 PM2 等进程管理工具 diff --git a/server/src/index.ts b/server/src/index.ts index ed837b3..2f673ff 100644 --- a/server/src/index.ts +++ b/server/src/index.ts @@ -8,22 +8,24 @@ import path from 'path' import { fileURLToPath } from 'url' import winston from 'winston' -import { TerminalManager } from './modules/terminal/TerminalManager' -import { GameManager } from './modules/game/GameManager' -import { SystemManager } from './modules/system/SystemManager' -import { ConfigManager } from './modules/config/ConfigManager' -import { AuthManager } from './modules/auth/AuthManager' -import { setupTerminalRoutes } from './routes/terminal' -import { setupGameRoutes } from './routes/games' -import { setupSystemRoutes } from './routes/system' -import { setupAuthRoutes } from './routes/auth' -import { setAuthManager } from './middleware/auth' +import { TerminalManager } from './modules/terminal/TerminalManager.js' +import { GameManager } from './modules/game/GameManager.js' +import { SystemManager } from './modules/system/SystemManager.js' +import { ConfigManager } from './modules/config/ConfigManager.js' +import { AuthManager } from './modules/auth/AuthManager.js' +import { setupTerminalRoutes } from './routes/terminal.js' +import { setupGameRoutes } from './routes/games.js' +import { setupSystemRoutes } from './routes/system.js' +import { setupAuthRoutes } from './routes/auth.js' +import { setAuthManager } from './middleware/auth.js' // 获取当前文件目录 const __filename = fileURLToPath(import.meta.url) const __dirname = path.dirname(__filename) // 加载环境变量 +// 首先尝试加载根目录的.env文件,然后加载server目录的.env文件 +dotenv.config({ path: path.join(__dirname, '../../.env') }) dotenv.config() // 配置日志 @@ -73,6 +75,7 @@ app.use(express.urlencoded({ extended: true, limit: '10mb' })) // 静态文件服务 app.use('/static', express.static(path.join(__dirname, '../public'))) +app.use(express.static(path.join(__dirname, '../public'))) // 管理器变量声明 let configManager: ConfigManager @@ -175,12 +178,18 @@ async function startServer() { app.use('/api/game', setupGameRoutes(gameManager)) app.use('/api/system', setupSystemRoutes(systemManager)) - // 404处理(必须在所有路由之后) - app.use('*', (req, res) => { - res.status(404).json({ - error: '接口不存在', - path: req.originalUrl - }) + // 前端路由处理(SPA支持) + app.get('*', (req, res) => { + // 如果是API请求,返回404 + if (req.path.startsWith('/api/')) { + res.status(404).json({ + error: '接口不存在', + path: req.originalUrl + }) + } else { + // 其他请求返回前端页面 + res.sendFile(path.join(__dirname, '../public/index.html')) + } }) // Socket.IO 连接处理 @@ -250,7 +259,7 @@ async function startServer() { }) }) - const PORT = parseInt(process.env.PORT || '3001', 10) + const PORT = parseInt(process.env.SERVER_PORT || process.env.PORT || '3001', 10) const HOST = process.env.HOST || '0.0.0.0' server.listen(PORT, HOST, () => { diff --git a/server/src/middleware/auth.ts b/server/src/middleware/auth.ts index c074c85..ac6cda1 100644 --- a/server/src/middleware/auth.ts +++ b/server/src/middleware/auth.ts @@ -1,6 +1,6 @@ import { Request, Response, NextFunction } from 'express' -import { AuthManager } from '../modules/auth/AuthManager' -import logger from '../utils/logger' +import { AuthManager } from '../modules/auth/AuthManager.js' +import logger from '../utils/logger.js' export interface AuthenticatedRequest extends Request { user?: { diff --git a/server/src/modules/auth/AuthManager.ts b/server/src/modules/auth/AuthManager.ts index af148b7..077e16a 100644 --- a/server/src/modules/auth/AuthManager.ts +++ b/server/src/modules/auth/AuthManager.ts @@ -3,7 +3,7 @@ import jwt from 'jsonwebtoken' import fs from 'fs/promises' import path from 'path' import winston from 'winston' -import { ConfigManager } from '../config/ConfigManager' +import { ConfigManager } from '../config/ConfigManager.js' export interface User { id: string @@ -223,7 +223,7 @@ export class AuthManager { role: user.role }, jwtConfig.secret, - { expiresIn: jwtConfig.expiresIn } + { expiresIn: jwtConfig.expiresIn as `${number}h` } ) this.logger.info(`用户 ${username} 登录成功`) diff --git a/server/src/modules/terminal/TerminalManager.ts b/server/src/modules/terminal/TerminalManager.ts index 675bcae..9eceeba 100644 --- a/server/src/modules/terminal/TerminalManager.ts +++ b/server/src/modules/terminal/TerminalManager.ts @@ -52,9 +52,9 @@ export class TerminalManager { // 根据操作系统选择PTY程序路径 const platform = os.platform() if (platform === 'win32') { - this.ptyPath = path.resolve(__dirname, '../../../PTY/pty_win32_x64.exe') + this.ptyPath = path.resolve(__dirname, '../../PTY/pty_win32_x64.exe') } else { - this.ptyPath = path.resolve(__dirname, '../../../PTY/pty_linux_x64') + this.ptyPath = path.resolve(__dirname, '../../PTY/pty_linux_x64') } this.logger.info(`终端管理器初始化完成,PTY路径: ${this.ptyPath}`) diff --git a/server/src/routes/auth.ts b/server/src/routes/auth.ts index 8a55729..f038708 100644 --- a/server/src/routes/auth.ts +++ b/server/src/routes/auth.ts @@ -1,8 +1,8 @@ import { Router, Request, Response } from 'express' import rateLimit from 'express-rate-limit' -import { AuthManager } from '../modules/auth/AuthManager' -import { authenticateToken, AuthenticatedRequest, requireAdmin } from '../middleware/auth' -import logger from '../utils/logger' +import { AuthManager } from '../modules/auth/AuthManager.js' +import { authenticateToken, AuthenticatedRequest, requireAdmin } from '../middleware/auth.js' +import logger from '../utils/logger.js' import Joi from 'joi' const router = Router() diff --git a/server/src/routes/games.ts b/server/src/routes/games.ts index 182e78d..d5d91c8 100644 --- a/server/src/routes/games.ts +++ b/server/src/routes/games.ts @@ -1,6 +1,6 @@ import { Router, Request, Response } from 'express' -import { GameManager } from '../modules/game/GameManager' -import logger from '../utils/logger' +import { GameManager } from '../modules/game/GameManager.js' +import logger from '../utils/logger.js' import Joi from 'joi' const router = Router() diff --git a/server/src/routes/index.ts b/server/src/routes/index.ts index 1614c75..3d3c6b5 100644 --- a/server/src/routes/index.ts +++ b/server/src/routes/index.ts @@ -1,8 +1,8 @@ import { Router } from 'express' -import terminalRoutes from './terminal' -import gameRoutes from './games' -import systemRoutes from './system' -import fileRoutes from './files' +import terminalRoutes from './terminal.js' +import gameRoutes from './games.js' +import systemRoutes from './system.js' +import fileRoutes from './files.js' const router = Router() diff --git a/server/src/routes/system.ts b/server/src/routes/system.ts index 0172c76..1c5d39b 100644 --- a/server/src/routes/system.ts +++ b/server/src/routes/system.ts @@ -1,6 +1,6 @@ import { Router, Request, Response } from 'express' -import { SystemManager } from '../modules/system/SystemManager' -import logger from '../utils/logger' +import { SystemManager } from '../modules/system/SystemManager.js' +import logger from '../utils/logger.js' import os from 'os' import fs from 'fs/promises' import path from 'path' diff --git a/server/src/routes/terminal.ts b/server/src/routes/terminal.ts index d561ba3..4fb98ce 100644 --- a/server/src/routes/terminal.ts +++ b/server/src/routes/terminal.ts @@ -1,6 +1,6 @@ import { Router, Request, Response } from 'express' -import { TerminalManager } from '../modules/terminal/TerminalManager' -import logger from '../utils/logger' +import { TerminalManager } from '../modules/terminal/TerminalManager.js' +import logger from '../utils/logger.js' const router = Router() diff --git a/server/tsconfig.json b/server/tsconfig.json index cc0ea95..8e6b54b 100644 --- a/server/tsconfig.json +++ b/server/tsconfig.json @@ -8,20 +8,21 @@ "allowSyntheticDefaultImports": true, "esModuleInterop": true, "allowJs": true, - "strict": true, + "strict": false, "noEmit": false, "declaration": true, "outDir": "./dist", "rootDir": "./src", "removeComments": true, - "noImplicitAny": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "noImplicitThis": true, - "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true, + "noImplicitAny": false, + "strictNullChecks": false, + "strictFunctionTypes": false, + "noImplicitThis": false, + "noImplicitReturns": false, + "noFallthroughCasesInSwitch": false, "skipLibCheck": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": false, + "noImplicitAny": false }, "include": [ "src/**/*" diff --git a/报错 b/报错.txt similarity index 100% rename from 报错 rename to 报错.txt