docs: 补充构建生产包的命令和部署文档

新增功能:
- 添加 npm run clean 命令用于清理构建产物
- 添加 npm run build:prod 命令用于生产环境构建
- 添加 npm run start:prod 命令用于生产环境启动
- 更新 .gitignore 忽略更多文件(logs、测试覆盖率等)

新增文档:
- 创建 DEPLOYMENT.md 部署文档,包含完整的部署指南
  - PM2 进程管理配置
  - Docker 容器化部署
  - 环境变量配置
  - 日志管理和数据备份
  - 常见问题排查

文档更新:
- 在 README.md 中添加"构建生产包"章节
- 列出所有可用的 NPM 脚本命令
- 说明构建流程和部署方式
- 添加详细的部署文档引用

这些改进使项目更容易部署到生产环境。

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
hughhuangandClaude Sonnet 4.5 committed 2026-01-15 21:39:32 +08:00
1 parent ccf523543a
commit f29dbc0118
5 files changed
+406 -3

No files matched your search

+5 -1
View File
@@ -5,11 +5,15 @@
"type": "module",
"main": "dist/index.js",
"scripts": {
"clean": "if exist dist (rmdir /s /q dist) && echo 'Cleaned dist directory' || echo 'No dist directory to clean'",
"build": "tsc",
"build:prod": "tsc",
"dev": "tsx watch src/index.ts",
"start": "node dist/index.js",
"start:prod": "set NODE_ENV=production&&node dist/index.js",
"typecheck": "tsc --noEmit",
"lint": "eslint src --ext .ts"
"lint": "eslint src --ext .ts",
"prepublishOnly": "npm run build"
},
"keywords": [
"贵金属",