Files
pr-preview/backend/package.json
T
luna 9645aebce1 fix(v2): deterministic Docker build — pin pnpm, fix supply-chain policy, workspace-level install
- Add workspace-level pnpm install in Dockerfile so pnpm-workspace.yaml
  supply-chain settings (onlyBuiltDependencies, allowBuilds) apply uniformly
- Pin pnpm@11.5.2 via corepack with sha1 hash to prevent future policy drift
- Downgrade postcss to ^8.5.22 (8.5.23 was <24h old, violated minimumReleaseAge)
- Regenerate frontend/pnpm-lock.yaml and add root pnpm-lock.yaml for full workspace
- Add binaryTargets to Prisma schema for linux-musl (Alpine) + debian compatibility
- Run pnpm approve-builds to set allowBuilds for esbuild, ssh2, prisma, @prisma/*
- Fix docker-compose.yml: postgres:18-alpine volume at /var/lib/postgresql (not /data)
- Add .env.docker.example; ignore .env.docker in .gitignore

Integration tests (Docker Compose against real Gitea 1.26.2):
 Docker image builds cleanly (pnpm frozen-lockfile, no policy violations)
 postgres:18-alpine starts healthy
 Prisma migrations run on startup
 Founder registration and session auth
 Gitea connection validated (PAT scope check)
 Webhook registered on test repo (Hook ID 11)
 PR opened → HMAC verified → preview created → DEPLOY job queued
 Gitea PR comment posted (write:issue scope confirmed working)
 Deploy fails correctly at AWS step: "Region is missing" (no creds in test env)
 PR closed → STOP job created and completed (status DONE)
 HMAC rejection: wrong signature → 401
 /pp stop via issue_comment webhook → accepted

Blocked (expected): EC2 provisioning requires AWS credentials not present in CI/test env.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-25 12:31:46 +00:00

42 lines
1.5 KiB
JSON

{
"name": "pp-backend",
"version": "1.0.0",
"description": "PR Previews backend",
"private": true,
"packageManager": "pnpm@11.5.2+sha1.7ab39d363d1ca5b2fb97795f45291083da4a1393",
"scripts": {
"dev": "rimraf dist && esbuild \"src/**/*.ts\" --platform=node --sourcemap --ignore-annotations --format=cjs --target=es2022 --outdir=dist && cd dist && node index.js",
"build": "rimraf dist && esbuild \"src/**/*.ts\" --platform=node --sourcemap --ignore-annotations --format=cjs --target=es2022 --outdir=dist",
"start": "cd dist && node index.js",
"prod": "pnpm build && pnpm start",
"migrate": "prisma migrate dev --schema=../prisma/schema.prisma",
"migrate:deploy": "prisma migrate deploy --schema=../prisma/schema.prisma",
"generate": "prisma generate --schema=../prisma/schema.prisma"
},
"dependencies": {
"@aws-sdk/client-ec2": "^3.800.0",
"@aws-sdk/client-sts": "^3.800.0",
"@prisma/client": "^6.0.0",
"@rjweb/runtime-node": "^1.1.1",
"@rjweb/utils": "^1.12.29",
"@types/bcryptjs": "^3.0.0",
"@types/node": "^22.0.0",
"@types/ssh2": "^1.15.0",
"@types/ws": "^8.5.0",
"axios": "^1.7.0",
"bcryptjs": "^3.0.3",
"dotenv": "^17.0.0",
"esbuild": "^0.25.0",
"node-cron": "^3.0.3",
"pino": "^10.0.0",
"pino-pretty": "^13.0.0",
"prisma": "^6.0.0",
"rimraf": "^5.0.0",
"rjweb-server": "^9.8.6",
"ssh2": "^1.16.0",
"typescript": "^5.0.0",
"ws": "^8.18.0",
"zod": "^3.24.0"
}
}