Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,20 @@ jobs:
yarn -v || true
(YARN_ENABLE_IMMUTABLE_INSTALLS=1 yarn install --immutable) || yarn install --frozen-lockfile

- name: Lint & Build
- name: GraphQL codegen
run: yarn graphql:codegen

- name: Type check
run: npx tsc --noEmit

- name: Lint
run: yarn lint

- name: Test
run: yarn test

- name: Build
run: |
yarn lint
yarn graphql:codegen
yarn graphql:docs
yarn build

Expand Down
94 changes: 94 additions & 0 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: PR Check

on:
pull_request:
branches: [main]

permissions:
contents: read

concurrency:
group: pr-check-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
check:
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js (24.x) & Yarn cache
uses: actions/setup-node@v4
with:
node-version: "24.x"
cache: "yarn"

- name: Install dependencies
run: |
corepack enable
yarn install --immutable

- name: GraphQL codegen
run: yarn graphql:codegen

- name: Type check
run: npx tsc --noEmit

- name: Lint
run: yarn lint

- name: Test with coverage
run: yarn test:cov

- name: Build
run: |
yarn graphql:docs
yarn build

coverage-report:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
pull-requests: write
checks: write

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js (24.x) & Yarn cache
uses: actions/setup-node@v4
with:
node-version: "24.x"
cache: "yarn"

- name: Install dependencies
run: |
corepack enable
yarn install --immutable

- name: Coverage Report
uses: ArtiomTr/jest-coverage-report-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
test-script: yarn jest --coverage --ci
skip-step: install

pr-title:
runs-on: ubuntu-latest
permissions:
pull-requests: read
steps:
- name: Validate PR title
uses: amannn/action-semantic-pull-request@v5
with:
subjectPattern: ^.+$
subjectPatternError: |
PR 제목이 Conventional Commits 형식이 아닙니다.
예: "feat: 새 기능 추가", "fix: 버그 수정"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yarn commitlint --edit $1
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yarn lint-staged
11 changes: 11 additions & 0 deletions commitlint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export default {
extends: ['@commitlint/config-conventional'],
rules: {
// 한국어 커밋 메시지를 허용하기 위해 subject 대소문자 규칙 비활성화
'subject-case': [0],
// 본문 최대 줄 길이 완화 (Co-Authored-By 등 긴 줄 허용)
'body-max-line-length': [0],
// footer 최대 줄 길이 완화
'footer-max-line-length': [0],
},
};
29 changes: 27 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"prisma:migrate:deploy": "prisma migrate deploy",
"prisma:studio": "prisma studio",
"graphql:codegen": "graphql-codegen --config codegen.yml",
"graphql:docs": "spectaql -c spectaql.yml"
"graphql:docs": "spectaql -c spectaql.yml",
"prepare": "husky"
},
"dependencies": {
"@apollo/server": "^5.2.0",
Expand Down Expand Up @@ -57,6 +58,8 @@
"winston": "^3.19.0"
},
"devDependencies": {
"@commitlint/cli": "^20.5.0",
"@commitlint/config-conventional": "^20.5.0",
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.18.0",
"@graphql-codegen/cli": "^6.1.1",
Expand All @@ -79,8 +82,10 @@
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-prettier": "^5.2.2",
"globals": "^16.0.0",
"husky": "^9.1.7",
"jest": "^29",
"langsmith": "^0.5.7",
"lint-staged": "^16.4.0",
"openai": "^6.27.0",
"prettier": "^3.4.2",
"prisma": "^6.2.0",
Expand All @@ -107,13 +112,33 @@
"^.+\\.(t|j)s$": "ts-jest"
},
"collectCoverageFrom": [
"**/*.(t|j)s"
"**/*.(t|j)s",
"!**/index.ts",
"!**/main.ts",
"!**/*.module.ts",
"!**/*.d.ts",
"!**/graphql/graphql.types.ts",
"!**/config/**"
],
"coverageThreshold": {
"global": {
"statements": 43,
"branches": 33,
"functions": 30,
"lines": 43
}
},
"coverageDirectory": "../coverage",
"testEnvironment": "node",
"moduleNameMapper": {
"^@/(.*)$": "<rootDir>/$1"
}
},
"lint-staged": {
"*.ts": [
"eslint --fix",
"prettier --write"
]
},
"packageManager": "yarn@4.9.4"
}
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ describe('SellerConversationService', () => {

expect(result.id).toBe('77');
expect(result.bodyText).toBe('테스트 메시지');
expect(conversationRepo.createSellerConversationMessage).toHaveBeenCalled();
expect(
conversationRepo.createSellerConversationMessage,
).toHaveBeenCalled();
expect(repo.createAuditLog).toHaveBeenCalled();
});

Expand Down
5 changes: 4 additions & 1 deletion src/global/graphql/scalars/date-time.scalar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@
* ISO DateTime 스칼라
*/
@Scalar('DateTime', () => Date)
export class DateTimeScalar implements CustomScalar<string, Date> {
/**
* 클라이언트 입력 값을 Date로 변환한다.
*/
parseValue(value: string): Date {
parseValue(value: unknown): Date {

Check warning on line 14 in src/global/graphql/scalars/date-time.scalar.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🕹️ Function is not covered

Warning! Not covered function
if (typeof value !== 'string') {
throw new TypeError('Invalid DateTime value.');

Check warning on line 16 in src/global/graphql/scalars/date-time.scalar.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
}

Check warning on line 17 in src/global/graphql/scalars/date-time.scalar.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

Check warning on line 17 in src/global/graphql/scalars/date-time.scalar.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
const date = new Date(value);
if (Number.isNaN(date.getTime())) {
throw new TypeError('Invalid DateTime value.');
Expand Down
6 changes: 2 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
"types": ["node", "jest"],
"incremental": true,
"skipLibCheck": true,
"strictNullChecks": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noImplicitAny": false,
"strictBindCallApply": false,
"noFallthroughCasesInSwitch": false
"noFallthroughCasesInSwitch": true
}
}
Loading
Loading