feat: 更新构建流程,添加 API 构建脚本和 SQL 文件复制脚本
- 修改 package.json,更新构建命令,添加 postbuild 脚本以复制 init.sql 文件。 - 新增 scripts/build-api.mjs,使用 esbuild 构建 API 代码。 - 新增 scripts/copy-init-sql.mjs,复制数据库初始化 SQL 文件到构建输出目录。 - 在 SubjectSelectionPage 组件中添加 totalScore 属性,增加历史最高分状态显示功能。 - 在 ExamSubjectPage 和 QuestionManagePage 中优化判断题答案处理逻辑。 - 在 OptionList 组件中将判断题选项文本从 'T' 和 'F' 改为 '对' 和 '错'。 - 在 QuizFooter 组件中调整样式,增加按钮和文本的可读性。 - 新增用户默认组测试用例,验证新用户创建后自动加入“全体用户”系统组。 - 新增 tsconfig.api.json,配置 API 相关 TypeScript 编译选项。 - 移除 vite.config.ts 中的 global 定义。
This commit is contained in:
20
deploy_bundle/server/ecosystem.config.cjs
Normal file
20
deploy_bundle/server/ecosystem.config.cjs
Normal file
@@ -0,0 +1,20 @@
|
||||
module.exports = {
|
||||
apps: [
|
||||
{
|
||||
name: 'blv-oa-exam-backend',
|
||||
script: 'dist/api/server.js',
|
||||
cwd: 'R:/nodejsROOT/oa_exam/server',
|
||||
interpreter: 'node',
|
||||
node_args: '--enable-source-maps',
|
||||
env: {
|
||||
NODE_ENV: 'production',
|
||||
PORT: '10012',
|
||||
DB_PATH: 'R:/nodejsROOT/oa_exam/db/survey.db',
|
||||
},
|
||||
time: true,
|
||||
autorestart: true,
|
||||
max_restarts: 10,
|
||||
restart_delay: 3000,
|
||||
},
|
||||
],
|
||||
};
|
||||
8370
deploy_bundle/server/package-lock.json
generated
Normal file
8370
deploy_bundle/server/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
56
deploy_bundle/server/package.json
Normal file
56
deploy_bundle/server/package.json
Normal file
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"name": "survey-system",
|
||||
"private": true,
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "concurrently \"npm run dev:api\" \"npm run dev:frontend\"",
|
||||
"dev:api": "nodemon --exec tsx api/server.ts",
|
||||
"dev:frontend": "vite",
|
||||
"build": "vite build && node scripts/build-api.mjs",
|
||||
"postbuild": "node scripts/copy-init-sql.mjs",
|
||||
"preview": "vite preview",
|
||||
"start": "node --enable-source-maps dist/api/server.js",
|
||||
"test": "node --import tsx --test test/admin-task-stats.test.ts test/question-text-import.test.ts test/swipe-detect.test.ts test/user-tasks.test.ts test/user-records-subjectname.test.ts test/score-percentage.test.ts",
|
||||
"check": "tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/axios": "^0.9.36",
|
||||
"antd": "^5.12.1",
|
||||
"axios": "^1.13.2",
|
||||
"concurrently": "^7.6.0",
|
||||
"cors": "^2.8.5",
|
||||
"dotenv": "^17.2.3",
|
||||
"express": "^4.18.2",
|
||||
"joi": "^17.11.0",
|
||||
"multer": "^1.4.5-lts.1",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-router-dom": "^6.20.1",
|
||||
"recharts": "^3.6.0",
|
||||
"sqlite3": "^5.1.7",
|
||||
"tailwind-merge": "^3.4.0",
|
||||
"uuid": "^9.0.1",
|
||||
"xlsx": "^0.18.5",
|
||||
"zustand": "^4.4.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/cors": "^2.8.17",
|
||||
"@types/crypto-js": "^4.2.2",
|
||||
"@types/express": "^4.17.21",
|
||||
"@types/multer": "^1.4.11",
|
||||
"@types/node": "^20.10.4",
|
||||
"@types/react": "^18.2.37",
|
||||
"@types/react-dom": "^18.2.15",
|
||||
"@types/uuid": "^9.0.7",
|
||||
"@vitejs/plugin-react": "^4.1.1",
|
||||
"autoprefixer": "^10.4.23",
|
||||
"crypto-js": "^4.2.0",
|
||||
"nodemon": "^3.0.2",
|
||||
"tailwindcss": "^3.3.6",
|
||||
"tsx": "^4.21.0",
|
||||
"esbuild": "^0.25.0",
|
||||
"typescript": "^5.2.2",
|
||||
"vite": "^4.5.0"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user