Skip to content
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

2주차 코드 프리징 - 프론트엔드 #76

Merged
merged 13 commits into from
Nov 7, 2024
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
10 changes: 7 additions & 3 deletions .github/workflows/fe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,14 @@ jobs:
node-version: 21.7.3

- name: Install dependencies
run: npm ci
run: |
cd ./fe
npm ci

- name: Build
run: npm run build
run: |
cd ./fe
npm run build

- name: Setup SSH
uses: webfactory/[email protected]
Expand All @@ -56,4 +60,4 @@ jobs:
sudo chown -R ${{ secrets.SSH_USER }}:${{ secrets.SSH_USER }} /var/www/clovapatra.com/html

- name: Transfer built files via rsync
run: rsync -avz -e 'ssh -p ${{ secrets.SERVER_PORT }}' ./dist/ ${{ secrets.SSH_USER }}@${{ secrets.SERVER_IP }}:/var/www/clovapatra.com/html
run: rsync -avz -e 'ssh -p ${{ secrets.SERVER_PORT }}' ./fe/dist/ ${{ secrets.SSH_USER }}@${{ secrets.SERVER_IP }}:/var/www/clovapatra.com/html
53 changes: 5 additions & 48 deletions fe/README.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,7 @@
# React + TypeScript + Vite
## 🔍 문제 해결 과정

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
### 새로고침 시 상태가 제대로 유지가 안 되고 있음

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

## Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:

- Configure the top-level `parserOptions` property like this:

```js
export default tseslint.config({
languageOptions: {
// other options...
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
},
})
```

- Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked`
- Optionally add `...tseslint.configs.stylisticTypeChecked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config:

```js
// eslint.config.js
import react from 'eslint-plugin-react'

export default tseslint.config({
// Set the react version
settings: { react: { version: '18.3' } },
plugins: {
// Add the react plugin
react,
},
rules: {
// other rules...
// Enable its recommended rules
...react.configs.recommended.rules,
...react.configs['jsx-runtime'].rules,
},
})
```
- 게임 페이지 내에서 새로고침 시 방장만 남고 입장한 참가자는 사라짐
- 계속 새로고침하면 렌더링도 안 됨
- 새로 생성한 방도 유지가 안 됨 -> 이건 DB에 저장이 안 되는 건가.. 뭐가 문제지.. 머리가 너무 아픔
20 changes: 20 additions & 0 deletions fe/components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "default",
"rsc": false,
"tsx": true,
"tailwind": {
"config": "tailwind.config.js",
"css": "src/index.css",
"baseColor": "slate",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
}
}
Loading