# 依赖和构建输出
node_modules
.next
out
build
dist

# 开发时需要的文件（运行时不需要）
# components - 保留，代码需要
types
!types
!types/**
next-env.d.ts

# 忽略的项目目录（不属于本项目）
flnxi_sucai
gongxiangp2
frp_*

# 开发工具和缓存目录（完全排除）
.kiro
.kiro/**
.cursor
.cursor/**
.vscode
.idea

# 构建缓存（完全排除，Docker 构建时直接挂载 /opt/build-cache/）
.build-cache
.build-cache/**
cache
cache/**
# 注意：.docker-cache/npm-packages.tgz 需要保留，Dockerfile 依赖它

# Git 相关
.git
.gitignore
.gitattributes

# 环境变量文件
.env
.env.local
.env.production
.env.development
.env*.local

# 用户上传的文件（关键优化！）
# 这里只排除项目根目录的真实上传文件，不能误伤 app/api/uploads、app/uploads 这类路由目录
/uploads
/uploads/**

# Prisma 引擎缓存（不需要在构建上下文中）
prisma/engine-cache
prisma/engine-cache/**
prisma/migrations
prisma/migrations/**
!prisma/migrations/
!prisma/migrations/**

# 备份文件
backups
backups/*
*.backup

# 日志文件
npm-debug.log*
yarn-debug.log*
yarn-error.log*
*.log

# 压缩包和临时文件
*.tar.gz
*.tar
*.zip
*.rar
*.7z
project*.tar.gz
frp*.tar.gz
.tmp-*.tar*
youyidian-3d-material*.tar
nextjs-*.tar.gz
api-compiled
nextjs-build

# 开发工具配置
.vscode
.idea
.cursor
*.swp
*.swo
*~

# 系统文件
.DS_Store
Thumbs.db
desktop.ini

# 文档和说明文件（不影响运行）
*.md
README*
CHANGELOG*
LICENSE
docs

# 本地临时产物目录（不进 git、也不该进构建上下文）。
# output/ 里含历史调查脚本，其中有无法通过 tsconfig 的旧 TS 文件，
# 若进入构建上下文会导致 next build 扫描失败。
output
outputs
tmp_epplus_probe
tmp_excel_cell_image_probe
migration-configs
资料
# 本地截图/临时克隆目录，不该进构建上下文
截图

# 根目录业务数据文件（历史导入/统计表，不进构建上下文）
*.xlsx
*.csv
*.ison.md

# 测试和覆盖率
coverage
.nyc_output
test
tests
**/*.test.js
**/*.spec.js

# 脚本文件（部署脚本不需要在容器中）
*.sh
!start.sh
update-deploy.sh
connect-nas.sh
deploy.sh
auto-deploy.sh
install.sh
*.ps1
scripts
scripts/**
!scripts/
!scripts/public-traffic-rollup-from-nginx.py
!scripts/collapse-performance-survey-template-versions.mjs
!scripts/check-legacy-storage-boundaries.mjs
!scripts/safe-production-migrate.mjs
!scripts/create-verified-production-backup.mjs
!scripts/verify-prisma-client-schema.mjs
!scripts/seed-team-function-config.ts
__tests__
*.test.ts
*.test.js
*.spec.ts
*.spec.js

# 其他临时文件
.cache
.tmp
tmp
temp
*.pid
*.seed
*.pid.lock

# SQL 文件和数据文件
*.sql
*.csv
*.json
!package.json
!package-lock.json
!tsconfig.json
!next.config.js
!tailwind.config.ts
!postcss.config.js
!jest.config.js
!jest.setup.js
*.txt
!README.md

# 旧的 JS 文件（不在 app 或 components 中）
shadow_*.js
*_page*.js
delete-text-materials.js
find-text-materials.js

# 部署和配置文件（不需要在容器中）
docker-compose*.yml
deploy-*.ps1
check-*.ps1
sync-*.ps1
verify-*.ps1
install-*.ps1
quick-*.ps1
cleanup-*.ps1
restore-*.sh
run-*.ps1
test-*.ps1

# 报告和分析文件
*-report.csv
*-report.json
*-stats*.csv
*-stats*.txt
*-inventory*.csv
*-inventory*.json
material-inventory-*.csv
material-inventory-*.json
old-materials-*.csv
missing-*.csv
missing-*.json
missing-*.txt
temp_*.sql

# Docker ignore 使用“最后匹配规则生效”。上面的全局 *.sql 规则不能再次
# 排除 Prisma 迁移，否则 builder/migrator 会在发布时缺少 migration.sql。
!prisma/migrations/
!prisma/migrations/**
!data/team-function-initial-content.json

# Private generated data never belongs to a build context.
/detail-generator-private
/detail-generator-private/**
/.private
/.private/**
/workers/detail-renderer/node_modules
/workers/detail-renderer/node_modules/**
!workers/detail-renderer/package.json
!workers/detail-renderer/package-lock.json
!public/detail-generator/fonts/OFL.txt

# Isolated migration tooling, locked to the application's dependency versions.
/workers/database-migrator/node_modules
/workers/database-migrator/node_modules/**
!workers/database-migrator/package.json
!workers/database-migrator/package-lock.json
!scripts/database-migrator-lock.mjs
