Skip to content

Commit

Permalink
Merge pull request #120 from boostcampwm-2024/feat/#119/check-workflow
Browse files Browse the repository at this point in the history
[Feat] PR lint, tsc, prettier 검사 workflow 구현
  • Loading branch information
simeunseo authored Nov 10, 2024
2 parents 9d9724d + 69191e1 commit 80a3dc5
Show file tree
Hide file tree
Showing 17 changed files with 528 additions and 28 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Check PR

on:
pull_request:
branches:
- main
- develop

jobs:
check:
runs-on: ubuntu-latest

steps:
- name: Checkout Branch
uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: latest

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'pnpm'

- name: Install Packages
run: pnpm install --frozen-lockfile

- name: Run Check Scripts
run: |
set -o pipefail
pnpm run check | tee check.log
- name: Print Summary
run: |
echo "## Check Result" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
echo "$(cat check.log)" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
4 changes: 2 additions & 2 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## .github/workflows/labeler.yml
name: labeler
name: PR Size Labeler

on: [pull_request]

Expand All @@ -13,7 +13,7 @@ jobs:
name: Label the PR size
steps:
- uses: codelytv/pr-size-labeler@v1

with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
xs_label: 'size/xs'
Expand Down
6 changes: 4 additions & 2 deletions apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
"scripts": {
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"format:check": "prettier --check \"src/**/*.ts\" \"test/**/*.ts\"",
"start": "nest start",
"dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\"",
"typecheck": "tsc --noEmit",
"test": "jest",
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
Expand All @@ -26,7 +28,7 @@
"@nestjs/platform-express": "^10.0.0",
"@nestjs/swagger": "^8.0.1",
"@nestjs/typeorm": "^10.0.2",
"@repo/shards": "workspace:*",
"@repo/shared": "workspace:*",
"@repo/types": "workspace:*",
"mysql2": "^3.11.3",
"reflect-metadata": "^0.2.0",
Expand Down
8 changes: 5 additions & 3 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint .",
"preview": "vite preview"
"typecheck": "tsc --noEmit",
"preview": "vite preview",
"format:check": "prettier --check \"src/**/*.{js,jsx,ts,tsx,json,md}\""
},
"dependencies": {
"@repo/shards": "workspace:*",
"@repo/shared": "workspace:*",
"@repo/types": "workspace:*",
"@tanstack/react-router": "^1.79.0",
"@tanstack/router-vite-plugin": "^1.79.0",
"prettier-plugin-tailwindcss": "^0.6.8",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
Expand All @@ -34,6 +35,7 @@
"eslint-plugin-react-refresh": "^0.4.14",
"globals": "^15.11.0",
"postcss": "^8.4.47",
"prettier-plugin-tailwindcss": "^0.6.8",
"tailwindcss": "^3.4.14",
"typescript": "~5.6.2",
"vite": "^5.4.10",
Expand Down
1 change: 1 addition & 0 deletions apps/web/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { createRouter, RouterProvider } from '@tanstack/react-router';

import { routeTree } from './routeTree.gen';

const router = createRouter({ routeTree });
declare module '@tanstack/react-router' {
interface Register {
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/common/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Link } from '@tanstack/react-router';
/**@desc router 테스트를 위해 임시 구현한 Header입니다. */
function Header() {
return (
<nav className="p-5 flex gap-2 border border-main">
<nav className="flex gap-2 border border-main p-5">
<Link to="/" className="[&.active]:font-bold">
티클
</Link>
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/dashboard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Link } from '@tanstack/react-router';
/**@desc router 테스트를 위해 임시 구현한 DashboardTab입니다. */
function DashboardTab() {
return (
<nav className="p-5 flex gap-2">
<nav className="flex gap-2 p-5">
<Link to="/dashboard/apply" className="[&.active]:font-bold">
신청한 티클 관리
</Link>
Expand Down
8 changes: 4 additions & 4 deletions apps/web/src/routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ function IndexPage() {
return (
<>
<Link to="/ticle/open">티클 개설하기</Link>
<div className="flex m-5 gap-2">
<Link to="/ticle/$ticleId" params={{ ticleId: '1' }} className="p-4 border border-main">
<div className="m-5 flex gap-2">
<Link to="/ticle/$ticleId" params={{ ticleId: '1' }} className="border border-main p-4">
Ticle 1
</Link>
<Link to="/ticle/$ticleId" params={{ ticleId: '2' }} className="p-4 border border-main">
<Link to="/ticle/$ticleId" params={{ ticleId: '2' }} className="border border-main p-4">
Ticle 2
</Link>
<Link to="/ticle/$ticleId" params={{ ticleId: '3' }} className="p-4 border border-main">
<Link to="/ticle/$ticleId" params={{ ticleId: '3' }} className="border border-main p-4">
Ticle 3
</Link>
</div>
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
"scripts": {
"dev": "turbo dev",
"lint": "turbo lint",
"typecheck": "turbo typecheck",
"build": "turbo run build",
"build:apps": "turbo run build --filter=./apps/*",
"build:packages": "turbo run build --filter=./packages/*",
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,md}\"",
"format:check": "prettier --check \"**/*.{js,jsx,ts,tsx,json,md}\"",
"prepare": "husky"
"prepare": "husky",
"check": "turbo run lint typecheck format:check --parallel"
},
"devDependencies": {
"husky": "^9.1.6",
Expand Down
4 changes: 0 additions & 4 deletions packages/eslint/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ module.exports = {
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-non-null-assertion': 'warn',
'padding-line-between-statements': [
'error',
{ blankLine: 'always', prev: 'import', next: '*' },
],

// 분리된 규칙들 병합
...namingConfig.rules,
Expand Down
1 change: 1 addition & 0 deletions packages/eslint/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,6 @@ module.exports = {
},
},
],
'import/newline-after-import': 'error',
},
};
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/shards/index.ts → packages/shared/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const shards = {
export const shared = {
asdasd: 1,
asdww: 1,
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@repo/shards",
"name": "@repo/shared",
"version": "0.0.0",
"private": true,
"main": "./dist/index.js",
Expand Down
File renamed without changes.
Loading

0 comments on commit 80a3dc5

Please sign in to comment.