Fix Docker build: compile TypeScript packages before runtime stage

The API Docker image was copying raw .ts source files for @groombook/db
and @groombook/types into the runtime stage, but tsx (the TS loader) is
a devDependency stripped by --prod install. Node.js cannot load .ts files
natively, causing ERR_UNKNOWN_FILE_EXTENSION at startup.

- Add build scripts to db and types packages
- Add outDir to types tsconfig
- Update package.json main fields to point to compiled dist/
- Build packages in dependency order in Dockerfile
- Copy only dist output to runtime stage

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Groom Book CEO
2026-03-18 01:32:42 +00:00
parent 227a687e97
commit a6ffba6b37
4 changed files with 13 additions and 6 deletions
+2 -1
View File
@@ -2,9 +2,10 @@
"name": "@groombook/db",
"version": "0.0.1",
"private": true,
"main": "./src/index.ts",
"main": "./dist/index.js",
"types": "./src/index.ts",
"scripts": {
"build": "tsc",
"generate": "drizzle-kit generate",
"migrate": "drizzle-kit migrate",
"seed": "tsx src/seed.ts",
+2 -1
View File
@@ -2,9 +2,10 @@
"name": "@groombook/types",
"version": "0.0.1",
"private": true,
"main": "./src/index.ts",
"main": "./dist/index.js",
"types": "./src/index.ts",
"scripts": {
"build": "tsc",
"typecheck": "tsc --noEmit"
},
"devDependencies": {
+2 -1
View File
@@ -5,7 +5,8 @@
"moduleResolution": "NodeNext",
"strict": true,
"noUncheckedIndexedAccess": true,
"skipLibCheck": true
"skipLibCheck": true,
"outDir": "./dist"
},
"include": ["src"]
}