Skip to content

TL-M0-10 · Create packages/db-types

Why: The generated database types live in this package and nothing else (D22); apps import them as @opleet/db-types. The Backend Engineer's pack E replaces the placeholder with the first generated types.

ID TL-M0-10 · Level L0 · Run order row 10

@opleet/db-types exists with a placeholder type and typechecks.

TL-M0-09 is Done.

Terminal window
mkdir -p packages/db-types/src
cat > packages/db-types/package.json <<'EOF'
{
"name": "@opleet/db-types",
"version": "0.0.0",
"private": true,
"type": "module",
"exports": {
".": "./src/database.ts"
},
"scripts": {
"typecheck": "tsc --noEmit"
}
}
EOF
cat > packages/db-types/tsconfig.json <<'EOF'
{
"extends": "../../tsconfig.base.json",
"include": ["src"]
}
EOF
cat > packages/db-types/src/database.ts <<'EOF'
// Placeholder until the first `pnpm db:types` writes the generated types here (D4, D22).
export type Database = Record<string, never>;
EOF

2 · Add TypeScript (the root's version) and typecheck the workspace

Section titled “2 · Add TypeScript (the root's version) and typecheck the workspace”
Terminal window
pnpm --filter @opleet/db-types add -D -E typescript@7.0.2
pnpm typecheck
Terminal window
git add -A
git commit -m "build(db-types): add the package shell"
  • Block 2 ends with “Tasks: 2 successful, 2 total” (web and db-types).
  • Block 3: the commit line.
Terminal window
pnpm ls -r --depth -1

Four entries: opleet, docs, web and @opleet/db-types.

typecheck fails in db-types: paste the output.

Terminal window
rm -rf packages/db-types
git checkout -- pnpm-lock.yaml
pnpm install

Done 2026-10-05 (zuki)