Repository navigation
chore: 코드베이스 초기 설정 #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 19 commits
d841b46
8812b4c
827223f
f679a6c
bd9a4f8
ce90973
c32753d
2ba5527
d8dcee8
ff0c219
597feaa
bfc0636
b89cea1
7644102
0cdec55
48ba064
780ae78
b372322
eebc98e
c5671d2
3bd3c53
f3552ad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| NODE_ENV=development | ||
| PORT=3000 | ||
| DATABASE_URL=postgres://postgres:postgres@localhost:5432/team_mino | ||
| DB_POOL_SIZE=10 | ||
|
|
||
| POSTGRES_HOST=localhost | ||
| POSTGRES_PORT=5432 | ||
| POSTGRES_USER=postgres | ||
| POSTGRES_PASSWORD=postgres | ||
| POSTGRES_DB=team_mino | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,27 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: CI | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| push: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| branches: [main] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ci: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: Lint & Test | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+3
to
+11
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win 중복 실행 방지를 위한 Line 3-11 기준으로 PR 업데이트 시 이전 실행을 취소하지 않아 CI 자원 낭비와 결과 지연이 발생할 수 있습니다. 🔧 제안 수정 on:
pull_request:
push:
branches: [main]
+concurrency:
+ group: ci-${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
jobs:
ci:📝 Committable suggestion
Suggested change
🧰 Tools🪛 zizmor (1.25.2)[warning] 3-6: insufficient job-level concurrency limits (concurrency-limits): workflow is missing concurrency setting (concurrency-limits) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+1
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Line 1-13 기준으로 워크플로우에 🔧 제안 수정 name: CI
on:
pull_request:
push:
branches: [main]
+permissions:
+ contents: read
+
jobs:
ci:📝 Committable suggestion
Suggested change
🧰 Tools🪛 zizmor (1.25.2)[warning] 1-28: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block (excessive-permissions) [warning] 3-6: insufficient job-level concurrency limits (concurrency-limits): workflow is missing concurrency setting (concurrency-limits) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - uses: oven-sh/setup-bun@v2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| bun-version: "1.3.14" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+14
to
+18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# 워크플로우에서 태그 기반 uses, 권한/토큰 설정 누락을 점검합니다.
rg -n '^\s*uses:\s*[^@]+@v[0-9]+' .github/workflows
rg -n 'persist-credentials|^\s*permissions:' .github/workflows/ci.ymlRepository: mash-up-kr/Team-MINO-Node Length of output: 284 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== ci.yml lines 1-60 ==="
nl -ba .github/workflows/ci.yml | sed -n '1,80p'
echo "=== persist-credentials occurrences ==="
rg -n 'persist-credentials' .github/workflows || true
echo "=== permissions occurrences (ci.yml) ==="
rg -n '^\s*permissions:' .github/workflows/ci.yml || trueRepository: mash-up-kr/Team-MINO-Node Length of output: 156 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== ci.yml lines 1-60 ==="
nl -ba .github/workflows/ci.yml | sed -n '1,80p'
echo "=== persist-credentials occurrences ==="
rg -n 'persist-credentials' .github/workflows || true
echo "=== permissions occurrences (ci.yml) ==="
rg -n '^\s*permissions:' .github/workflows/ci.yml || trueRepository: mash-up-kr/Team-MINO-Node Length of output: 156 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== workflow files ==="
find .github/workflows -maxdepth 1 -type f \( -name '*.yml' -o -name '*.yaml' \) -print | sort
echo "=== ci.yml (raw, first 120 lines) ==="
if [ -f .github/workflows/ci.yml ]; then
sed -n '1,120p' .github/workflows/ci.yml
else
echo "Missing: .github/workflows/ci.yml"
fi
echo "=== persist-credentials occurrences ==="
rg -n 'persist-credentials' .github/workflows || true
echo "=== permissions occurrences in ci.yml ==="
if [ -f .github/workflows/ci.yml ]; then
rg -n '^\s*permissions:' .github/workflows/ci.yml || true
fi
echo "=== uses@v in ci.yml ==="
if [ -f .github/workflows/ci.yml ]; then
rg -n '^\s*uses:\s*[^@]+@v[0-9]+' .github/workflows/ci.yml || true
fiRepository: mash-up-kr/Team-MINO-Node Length of output: 777 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== workflow files ==="
find .github/workflows -maxdepth 1 -type f \( -name '*.yml' -o -name '*.yaml' \) -print | sort
echo "=== ci.yml (raw, first 120 lines) ==="
if [ -f .github/workflows/ci.yml ]; then
sed -n '1,120p' .github/workflows/ci.yml
else
echo "Missing: .github/workflows/ci.yml"
fi
echo "=== persist-credentials occurrences ==="
rg -n 'persist-credentials' .github/workflows || true
echo "=== permissions occurrences in ci.yml ==="
if [ -f .github/workflows/ci.yml ]; then
rg -n '^\s*permissions:' .github/workflows/ci.yml || true
fi
echo "=== uses@v in ci.yml ==="
if [ -f .github/workflows/ci.yml ]; then
rg -n '^\s*uses:\s*[^@]+@v[0-9]+' .github/workflows/ci.yml || true
fiRepository: mash-up-kr/Team-MINO-Node Length of output: 777 🌐 Web query:
💡 Result: In GitHub Actions Citations:
CI 워크플로우에서 File: - uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: "1.3.14"
🔧 제안 수정 steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@<FULL_SHA_FOR_V4>
+ with:
+ persist-credentials: false
- - uses: oven-sh/setup-bun@v2
+ - uses: oven-sh/setup-bun@<FULL_SHA_FOR_V2>
with:
bun-version: "1.3.14"🧰 Tools🪛 zizmor (1.25.2)[warning] 14-14: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false (artipacked) [error] 14-14: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) [error] 16-16: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Install dependencies | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: bun install --frozen-lockfile | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Check (lint + format + imports) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: bun run check | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Test | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: bun run test | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| # Team MINO Node | ||
|
|
||
| NestJS 기반 Team MINO 백엔드 API 서버입니다. | ||
|
|
||
| ## Requirements | ||
|
|
||
| - Bun 1.3.x | ||
| - Docker | ||
|
|
||
| ## Setup Guide | ||
|
|
||
| ### 1. Install Dependencies | ||
|
|
||
| ```bash | ||
| bun install | ||
| ``` | ||
|
|
||
| ### 2. Configure Environment | ||
|
|
||
| ```bash | ||
| cp .env.example .env | ||
| ``` | ||
|
|
||
| 기본 로컬 DB 연결 정보는 아래 값입니다. | ||
|
|
||
| ```env | ||
| DATABASE_URL=postgres://postgres:postgres@localhost:5432/team_mino | ||
| ``` | ||
|
|
||
| ### 3. Start Local Database | ||
|
|
||
| ```bash | ||
| docker compose up -d postgres | ||
| ``` | ||
|
|
||
| 컨테이너 상태를 확인합니다. | ||
|
|
||
| ```bash | ||
| docker compose ps | ||
| ``` | ||
|
|
||
| ### 4. Start Development Server | ||
|
|
||
| ```bash | ||
| bun run start:dev | ||
| ``` | ||
|
|
||
| 서버 기본 포트는 `3000`입니다. | ||
|
|
||
| ```text | ||
| http://localhost:3000 | ||
| ``` | ||
|
|
||
| ### 5. Check Health API | ||
|
|
||
| ```bash | ||
| curl http://localhost:3000/health | ||
| ``` | ||
|
|
||
| 정상 응답은 아래와 같습니다. | ||
|
|
||
| ```json | ||
| { | ||
| "status": "ok" | ||
| } | ||
| ``` | ||
|
|
||
| ## Available Scripts | ||
|
|
||
| ```bash | ||
| bun run start:dev | ||
| bun run build | ||
| bun run check | ||
| bun run lint | ||
| bun run format | ||
| bun run test | ||
| ``` | ||
|
|
||
| ## API Docs | ||
|
|
||
| 개발 서버 실행 후 Swagger 문서는 아래 경로에서 확인할 수 있습니다. | ||
|
|
||
| ```text | ||
| http://localhost:3000/api-docs | ||
| ``` | ||
|
|
||
| ## Database | ||
|
|
||
| 로컬 PostgreSQL은 Docker Compose로 실행합니다. | ||
|
|
||
| ```bash | ||
| docker compose up -d postgres | ||
| docker compose down | ||
| ``` | ||
|
|
||
| Drizzle 설정은 `drizzle.config.ts`를 사용합니다. | ||
|
|
||
| ```bash | ||
| bun run db:generate | ||
| bun run db:migrate | ||
| bun run db:push | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| { | ||
| "$schema": "https://biomejs.dev/schemas/2.4.15/schema.json", | ||
| "files": { | ||
| "includes": ["**", "!dist", "!node_modules"] | ||
| }, | ||
| "formatter": { | ||
| "enabled": true, | ||
| "indentStyle": "space", | ||
| "indentWidth": 2 | ||
| }, | ||
| "assist": { | ||
| "actions": { | ||
| "source": { | ||
| "organizeImports": "on" | ||
| } | ||
| } | ||
| }, | ||
| "linter": { | ||
| "enabled": true, | ||
| "rules": { | ||
| "recommended": true, | ||
| "style": { | ||
| "useImportType": "off" | ||
| } | ||
| } | ||
| } | ||
| } |
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,21 @@ | ||||||||||
| services: | ||||||||||
| postgres: | ||||||||||
| image: postgres:18-alpine | ||||||||||
| container_name: team-mino-postgres | ||||||||||
| restart: unless-stopped | ||||||||||
| ports: | ||||||||||
| - "${POSTGRES_PORT:-5432}:5432" | ||||||||||
| environment: | ||||||||||
| POSTGRES_USER: ${POSTGRES_USER:-postgres} | ||||||||||
| POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres} | ||||||||||
| POSTGRES_DB: ${POSTGRES_DB:-team_mino} | ||||||||||
| volumes: | ||||||||||
| - postgres_data:/var/lib/postgresql/data | ||||||||||
|
Comment on lines
+12
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: No, mounting a volume at /var/lib/postgresql/data does not persist data in the way it did in previous versions for PostgreSQL 18 and newer [1][2]. In PostgreSQL 18+, the official Docker image structure has changed significantly [1][2]: 1. Changed Data Location: The default data directory (PGDATA) is now located at /var/lib/postgresql/18/docker [3][2]. 2. Volume Mount Point: The VOLUME directive in the Dockerfile has been moved from /var/lib/postgresql/data to /var/lib/postgresql [2]. 3. No Compatibility Symlink: While there was an initial attempt to include a compatibility symlink, it was explicitly removed in the Alpine images (and others) to avoid issues [4]. If you attempt to mount a volume at /var/lib/postgresql/data, it will generally be ignored or result in an unused mount point, because the container expects the data to reside within the /var/lib/postgresql directory structure [1][3]. Recommended Configuration: To ensure data persists correctly in PostgreSQL 18+, you should mount your volume at the parent directory: volumes: - my_db_data:/var/lib/postgresql This configuration allows PostgreSQL to place its data in the correct version-specific subdirectory (e.g., /var/lib/postgresql/18/docker), which is essential for proper functionality and future upgrades using tools like pg_upgrade [1][3]. If you persist in using the old mount path, you may encounter silent data loss where the container initializes a new database in an anonymous volume while ignoring your existing data on the host [3]. Citations:
PostgreSQL 18용 볼륨 마운트 경로를 현재 권장 예시 volumes:
- - postgres_data:/var/lib/postgresql/data
+ - postgres_data:/var/lib/postgresql이전 리뷰에서 언급된 대로 compose를(KKardy가) 별도로 정비할 때 함께 반영해 주세요. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||
| healthcheck: | ||||||||||
| test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"] | ||||||||||
| interval: 5s | ||||||||||
| timeout: 5s | ||||||||||
| retries: 5 | ||||||||||
|
|
||||||||||
| volumes: | ||||||||||
| postgres_data: | ||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,16 @@ | ||||||||||||||||||||||||||||||||||
| import { defineConfig } from "drizzle-kit"; | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| const databaseUrl = process.env.DATABASE_URL; | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| if (!databaseUrl) { | ||||||||||||||||||||||||||||||||||
| throw new Error("DATABASE_URL is required"); | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+3
to
+7
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
빈 값만 막고 있어서 오타 URL이 들어오면 이후 단계에서 에러가 납니다. 여기서 즉시 검증하면 원인 파악이 쉬워집니다. 수정 예시 const databaseUrl = process.env.DATABASE_URL;
if (!databaseUrl) {
throw new Error("DATABASE_URL is required");
}
+
+try {
+ new URL(databaseUrl);
+} catch {
+ throw new Error("DATABASE_URL must be a valid URL");
+}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export default defineConfig({ | ||||||||||||||||||||||||||||||||||
| schema: "./src/database/schema/index.ts", | ||||||||||||||||||||||||||||||||||
| out: "./drizzle", | ||||||||||||||||||||||||||||||||||
| dialect: "postgresql", | ||||||||||||||||||||||||||||||||||
| dbCredentials: { | ||||||||||||||||||||||||||||||||||
| url: databaseUrl, | ||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,23 @@ | ||
| { | ||
| "name": "team-mino", | ||
| "version": "1.0.0", | ||
| "packageManager": "bun@1.3.14", | ||
| "main": "dist/src/main", | ||
| "scripts": { | ||
| "build": "bun run scripts/build.ts", | ||
| "check": "biome check .", | ||
| "db:generate": "drizzle-kit generate", | ||
| "db:migrate": "drizzle-kit migrate", | ||
| "db:push": "drizzle-kit push", | ||
| "format": "biome format --write .", | ||
| "lint": "biome lint .", | ||
| "start": "nest start", | ||
| "start:dev": "nest start --watch", | ||
| "start:prod": "./dist/server", | ||
| "test": "bun test test/" | ||
| "test": "bun test test/", | ||
| "test:watch": "bun test --watch", | ||
| "typecheck": "tsgo --noEmit", | ||
| "typecheck:tsc": "tsc --noEmit" | ||
| }, | ||
| "keywords": [], | ||
| "author": "", | ||
|
|
@@ -15,18 +26,27 @@ | |
| "dependencies": { | ||
| "@kiyasov/platform-hono": "^2.0.3", | ||
| "@nestjs/common": "^11.1.24", | ||
| "@nestjs/config": "^4.0.2", | ||
| "@nestjs/config": "^4.0.4", | ||
| "@nestjs/core": "^11.1.24", | ||
| "@nestjs/swagger": "^11.4.4", | ||
| "@nestjs/terminus": "^11.1.1", | ||
| "drizzle-orm": "^0.45.2", | ||
| "nestjs-pino": "^4.6.1", | ||
| "pino-http": "^11.0.0", | ||
| "reflect-metadata": "^0.2.2" | ||
| "postgres": "^3.4.9", | ||
| "reflect-metadata": "^0.2.2", | ||
| "valibot": "^1.4.1" | ||
| }, | ||
| "devDependencies": { | ||
| "@biomejs/biome": "^2.4.15", | ||
| "@nestjs/cli": "^11.0.21", | ||
| "@nestjs/schematics": "^11.1.0", | ||
| "@nestjs/testing": "^11.1.24", | ||
| "@types/bun": "^1.3.14", | ||
| "@types/node": "^25.9.1", | ||
| "@typescript/native-preview": "^7.0.0-dev.20260421.2", | ||
| "drizzle-kit": "^0.31.10", | ||
| "pino-pretty": "^13.1.3", | ||
| "typescript": "^5.9.3" | ||
| "typescript": "^6.0.0" | ||
|
Comment on lines
+47
to
+50
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# TypeScript 설정 검증
echo "=== Running TypeScript compiler (tsc) ==="
bun run typecheck:tsc
echo ""
echo "=== Running tsgo compiler ==="
bun run typecheck
echo ""
echo "=== Running NestJS build ==="
bun run buildRepository: mash-up-kr/Team-MINO-Node Length of output: 319 🌐 Web query:
💡 Result: NestJS 11 is compatible with TypeScript 6.0.x in practice, but you should verify via your specific NestJS 11 package versions because NestJS 11’s repo has been pinned to TypeScript 5.9.x at various points. What we can say with sources: 1) TypeScript 6.0.0 was released in March 2026, and it is positioned as the “last release based on the current JavaScript codebase” (i.e., it’s a normal compiler release intended for adoption) [1]. 2) NestJS 11 requires Node.js v20 or higher [2], but those sources do not state any explicit NestJS 11 incompatibility with TypeScript 6.0.0. 3) However, the NestJS repo has been updated to TypeScript 5.9.3 in its dependencies (example commits show TypeScript moving within the 5.9 series) [3], and there is evidence of a pending bump from TypeScript 5.9.3 to 6.0.2 in April 2026 [4]. That strongly suggests the maintainers were still targeting the 5.9.x line during early/mid 2026, and TypeScript 6 adoption was actively being rolled in. Practical recommendation for today (2026-05-29): - If you want the safest “supported by the repo” path, start with TypeScript 5.9.x, aligning with NestJS 11’s visible dependency target (e.g., 5.9.3) [3]. - If you specifically need TypeScript 6.0.0/6.x, it should generally work because NestJS is TypeScript-authored and TypeScript’s 6.0 is a standard compiler release [1], but you may encounter build/tooling issues in your exact stack (SWC/ts-jest/ts-node/eslint plugins, etc.). If you tell me your exact NestJS 11 package set (e.g., Citations:
🏁 Script executed: #!/bin/bash
set -euo pipefail
# Show package.json around the mentioned lines and also scripts/deps
echo "=== package.json (relevant section) ==="
nl -ba package.json | sed -n '1,120p'
echo
echo "=== Extract dependency versions for TypeScript packages ==="
node -e "const p=require('./package.json'); const d=p.dependencies||{}; const dev=p.devDependencies||{}; const all={...d,...dev}; ['typescript','`@typescript/native-preview`','tsgo','drizzle-kit','drizzle-orm'].forEach(k=>{ if(all[k]) console.log(k+':', all[k]); });"
echo
echo "=== package.json scripts (typecheck/build) ==="
node -e "const p=require('./package.json'); const s=p.scripts||{}; Object.keys(s).filter(k=>/typecheck|tsc|tsgo|build/i.test(k)).sort().forEach(k=>console.log(k+':', s[k]));"Repository: mash-up-kr/Team-MINO-Node Length of output: 170 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== package.json (relevant section) ==="
cat -n package.json | sed -n '1,120p'
echo
echo "=== Extract dependency versions for TypeScript packages ==="
node -e "const p=require('./package.json'); const d=p.dependencies||{}; const dev=p.devDependencies||{}; const all={...d,...dev}; ['typescript','`@typescript/native-preview`','drizzle-kit','drizzle-orm'].forEach(k=>{ if(all[k]) console.log(k+':', all[k]); else console.log(k+': (not found)'); });"
echo
echo "=== package.json scripts (typecheck/build) ==="
node -e "const p=require('./package.json'); const s=p.scripts||{}; Object.keys(s).filter(k=>/typecheck|tsc|tsgo|build/i.test(k)).sort().forEach(k=>console.log(k+':', s[k]));"Repository: mash-up-kr/Team-MINO-Node Length of output: 2129 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== tsconfig files ==="
fd -t f "tsconfig*.json" . || true
echo
echo "=== nest-cli config files ==="
fd -t f "nest-cli*.json" . || true
fd -t f "nest*.json" . -g "*nest*cli*.json" || true
echo
echo "=== Print nest-cli.json if present ==="
for f in $(fd -t f -g "nest-cli.json" .); do
echo "--- $f ---"
head -n 120 "$f" | cat -n
done || true
echo
echo "=== Print tsconfig.json (or first found) ==="
for f in $(fd -t f -g "tsconfig.json" .); do
echo "--- $f ---"
head -n 160 "$f" | cat -n
done || true
echo
echo "=== Search for tsgo/tsc/nest build related config ==="
rg -n --hidden --glob '!**/node_modules/**' "(tsgo|tsc|typescript|nest build|nest-cli)" package.json tsconfig*.json nest-cli*.json 2>/dev/null || trueRepository: mash-up-kr/Team-MINO-Node Length of output: 2134 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== tsconfig.build.json ==="
if [ -f tsconfig.build.json ]; then
cat -n tsconfig.build.json
else
echo "tsconfig.build.json not found"
fi
echo
echo "=== Locate tsgo usage/config ==="
rg -n --hidden --glob '!**/node_modules/**' "tsgo" . || true
echo
echo "=== Check whether tsgo is declared in package.json ==="
node -e "const p=require('./package.json'); const all={...(p.dependencies||{}),...(p.devDependencies||{})}; console.log('tsgo:', all.tsgo || '(not declared)');"
echo
echo "=== Quick look at package-lock/pnpm/yarn presence (if any) ==="
ls -la | headRepository: mash-up-kr/Team-MINO-Node Length of output: 1717 🏁 Script executed: #!/bin/bash
# TypeScript 설정 검증
echo "=== Running TypeScript compiler (tsc) ==="
bun run typecheck:tsc
echo ""
echo "=== Running tsgo compiler ==="
bun run typecheck
echo ""
echo "=== Running NestJS build ==="
bun run buildRepository: mash-up-kr/Team-MINO-Node Length of output: 319 🌐 Web query:
💡 Result: The Citations:
🌐 Web query:
💡 Result: The nest build command uses the TypeScript version installed as a local dependency in your project's node_modules directory [1][2]. When you create a new NestJS project, the Nest CLI automatically adds typescript as a devDependency in your package.json file [1][2]. The nest build command is designed as a wrapper around the standard tsc (TypeScript compiler) or build tools like webpack (in monorepos) [1][2][3]. Because it relies on these locally installed tools, the build process consistently uses the version of TypeScript defined in your project's local dependency tree, ensuring that all environments—such as your local machine, team members' machines, or CI/CD pipelines—utilize the same compiler version [1][2]. If you encounter issues related to compiler features or errors, you should verify the version specified in your project's package.json or lock file, as the CLI will utilize whichever version is resolved by your package manager (e.g., npm, pnpm, or yarn) in the local node_modules [4]. Citations:
🏁 Script executed: #!/bin/bash
# TypeScript 설정 검증
echo "=== typecheck:tsc (TS 6.x) ==="
bun run typecheck:tsc
echo "=== typecheck (tsgo / native-preview: TS 7.0 preview) ==="
bun run typecheck
echo "=== nest build (uses local typescript: TS 6.x) ==="
bun run buildRepository: mash-up-kr/Team-MINO-Node Length of output: 356
현재 다음 확인/조치가 필요합니다.
🤖 Prompt for AI Agents |
||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| import * as v from "valibot"; | ||
|
|
||
| const envSchema = v.object({ | ||
| NODE_ENV: v.optional( | ||
| v.picklist(["development", "test", "production"]), | ||
| "development", | ||
| ), | ||
| PORT: v.optional(v.pipe(v.string(), v.regex(/^\d+$/), v.transform(Number), v.minValue(1), v.maxValue(65535)), "3000"), | ||
| DATABASE_URL: v.pipe(v.string(), v.minLength(1), v.url()), | ||
| DB_POOL_SIZE: v.optional(v.pipe(v.string(), v.regex(/^\d+$/), v.transform(Number), v.minValue(1)), "10"), | ||
| }); | ||
|
|
||
| export type Env = v.InferOutput<typeof envSchema>; | ||
|
|
||
| export function validateEnv(config: Record<string, unknown>): Env { | ||
| const result = v.safeParse(envSchema, config); | ||
|
|
||
| if (!result.success) { | ||
| const messages = result.issues | ||
| .map((issue) => { | ||
| const path = | ||
| issue.path?.map((item) => String(item.key)).join(".") ?? "unknown"; | ||
|
|
||
| return `${path}: ${issue.message}`; | ||
| }) | ||
| .join("\n"); | ||
|
|
||
| throw new Error(`Invalid environment variables:\n${messages}`); | ||
| } | ||
|
|
||
| return result.output; | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import { Module } from "@nestjs/common"; | ||
| import { DatabaseService } from "./database.service"; | ||
|
|
||
| @Module({ | ||
| providers: [DatabaseService], | ||
| exports: [DatabaseService], | ||
| }) | ||
| export class DatabaseModule {} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import { Injectable, type OnModuleDestroy } from "@nestjs/common"; | ||
| import { ConfigService } from "@nestjs/config"; | ||
| import { drizzle } from "drizzle-orm/postgres-js"; | ||
| import postgres from "postgres"; | ||
| import type { Env } from "../config/env.schema"; | ||
|
|
||
| @Injectable() | ||
| export class DatabaseService implements OnModuleDestroy { | ||
| private readonly client: ReturnType<typeof postgres>; | ||
| readonly db: ReturnType<typeof drizzle>; | ||
|
|
||
| constructor(configService: ConfigService<Env>) { | ||
| const databaseUrl = configService.getOrThrow("DATABASE_URL", { infer: true }); | ||
| const max = configService.get("DB_POOL_SIZE", 10, { infer: true }); | ||
|
|
||
| this.client = postgres(databaseUrl, { | ||
| max, | ||
| }); | ||
| this.db = drizzle(this.client); | ||
| } | ||
|
|
||
| async onModuleDestroy() { | ||
| await this.client.end(); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export {}; |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
디비 풀 기본값은 Supabase 환경 고려해서 수정이 필요할 수도 있는거죠?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Supabase PgBouncer 사용한다면 풀은 1~2로 줄일게요!