Skip to content

Commit

Permalink
Chore: 변경된 Prettier 및 ESLint 룰 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
sscoderati committed Dec 13, 2023
1 parent b1b209d commit 6c6c9d4
Show file tree
Hide file tree
Showing 14 changed files with 128 additions and 97 deletions.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ assignees: ''
## 버그 작업 브랜치

## ☑ Bug Fix TODOS

- [ ] 작업
3 changes: 2 additions & 1 deletion .github/ISSUE_TEMPLATE/feature.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ labels: Feature
assignees: ''

---

## 🚀 어떤 기능을 만드나요?

## 작업 중인 브랜치

## ☑ Implement TODO

- [ ] 작업
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/style.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ assignees: ''

---


## ✨ 어떤 Style 작업인가요?

## 스타일 작업 브랜치

## ☑ Style TODO

- [ ] 작업
4 changes: 4 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
## 이슈번호

<!-- - close 뒤에 이슈 달아주기 -->
close: #

## 작업 내용 설명

<!-- 스크린샷 및 작업내용을 적어주세요 -->
-

## 리뷰어에게 한마디

<!-- 리뷰어들이 참고해야 하는 사항을 적어주세요 -->
4 changes: 2 additions & 2 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Build Test

on:
push:
branches: [main, dev]
branches: [ main, dev ]
pull_request:
branches: [main, dev]
branches: [ main, dev ]
workflow_dispatch:

jobs:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
Expand All @@ -21,7 +21,7 @@ jobs:
id: cache
uses: actions/cache@v3
with:
# cache의 대상을 정합니다. npm에서 의존성이 설치되는 디렉터리인 node_modules를 대상으로 합니다.
# cache의 대상을 정합니다. npm에서 의존성이 설치되는 디렉터리인 node_modules를 대상으로 합니다.
path: '**/node_modules'
# cache를 무효화하를 결정하는 기준은 의존성이 변경되면 함께 변경되는 파일인 package-lock.json을 기준으로 합니다.
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
Expand All @@ -41,7 +41,7 @@ jobs:

- name: S3 Deploy
run: aws s3 sync ./dist s3://coffee-meet-frontend-s3/ --acl bucket-owner-full-control # 현재 build된 폴더에 접근 후 s3 버킷인 coffee-meet-frontend-s3에 파일 업로드
env:
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ This template provides a minimal setup to get React working in Vite with HMR and

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
- [@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

Expand All @@ -22,6 +24,8 @@ If you are developing a production application, we recommend updating the config
},
```

- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked`
or `plugin:@typescript-eslint/strict-type-checked`
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and
add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
24 changes: 12 additions & 12 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<!doctype html>
<html lang="ko">
<head>
<meta charset="UTF-8" />
<meta name="mobile-web-app-capable" content="yes">
<link rel="manifest" href="/manifest.json">
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>CoffeeMeet</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
<head>
<meta charset="UTF-8" />
<meta content="yes" name="mobile-web-app-capable">
<link href="/manifest.json" rel="manifest">
<link href="/favicon.svg" rel="icon" type="image/svg+xml" />
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
<title>CoffeeMeet</title>
</head>
<body>
<div id="root"></div>
<script src="/src/main.tsx" type="module"></script>
</body>
</html>
78 changes: 40 additions & 38 deletions public/firebase-messaging-sw.js
Original file line number Diff line number Diff line change
@@ -1,61 +1,63 @@
self.addEventListener('install', function (e) {
console.log('fcm sw install..')
self.skipWaiting()
})

self.addEventListener('activate', function (e) {
console.log('fcm sw activate..')
})

self.addEventListener('push', function (e) {
console.log('push: ', e.data.json())
if (!e.data.json()) return
self.addEventListener("install", function (e) {
console.log("fcm sw install..");
self.skipWaiting();
});

self.addEventListener("activate", function (e) {
console.log("fcm sw activate..");
});

self.addEventListener("push", function (e) {
console.log("push: ", e.data.json());
if (!e.data.json()) {
return;
}

const resultData = e.data.json().notification
const notificationTitle = resultData.title
const resultData = e.data.json().notification;
const notificationTitle = resultData.title;
const notificationOptions = {
body: resultData.body,
icon: resultData.image,
tag: resultData.tag,
...resultData,
}
self.registration.showNotification(notificationTitle, notificationOptions)
console.log('push: ', { resultData, notificationTitle, notificationOptions })
};
self.registration.showNotification(notificationTitle, notificationOptions);
console.log("push: ", { resultData, notificationTitle, notificationOptions });
//indexedDB에 상태 저장하는 기능 추가
saveDataToIndexedDB('isMatchingSuccess', true)
})
saveDataToIndexedDB("isMatchingSuccess", true);
});

// IndexedDB에 데이터를 저장하는 함수
function saveDataToIndexedDB(key, value) {
const request = indexedDB.open('matching-database')
const request = indexedDB.open("matching-database");

request.onupgradeneeded = function (event) {
const db = event.target.result
const db = event.target.result;

db.createObjectStore('my-store', { autoIncrement: true })
}
db.createObjectStore("my-store", { autoIncrement: true });
};

request.onsuccess = function (event) {
const db = event.target.result
const tx = db.transaction('my-store', 'readwrite')
const store = tx.objectStore('my-store')
store.put(value, key)
const db = event.target.result;
const tx = db.transaction("my-store", "readwrite");
const store = tx.objectStore("my-store");
store.put(value, key);

tx.oncomplete = function () {
db.close()
}
}
db.close();
};
};

request.onerror = function (event) {
console.error('Error opening IndexedDB:', event.target.error)
}
console.error("Error opening IndexedDB:", event.target.error);
};
}

self.addEventListener('notificationclick', function (event) {
console.log('notification click')
const url = '/'
event.notification.close()
self.addEventListener("notificationclick", function (event) {
console.log("notification click");
const url = "/";
event.notification.close();

// eslint-disable-next-line no-undef
event.waitUntil(clients.openWindow(url))
})
event.waitUntil(clients.openWindow(url));
});
26 changes: 13 additions & 13 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"short_name": "CoffeeMeet",
"name": "CoffeeMeet",
"icons": [
{
"src": "coffee.png",
"sizes": "192x192",
"type": "image/png"
}
],
"start_url": "/index.html",
"display": "standalone",
"orientation": "landscape"
}
"short_name": "CoffeeMeet",
"name": "CoffeeMeet",
"icons": [
{
"src": "coffee.png",
"sizes": "192x192",
"type": "image/png"
}
],
"start_url": "/index.html",
"display": "standalone",
"orientation": "landscape"
}

32 changes: 16 additions & 16 deletions public/timerWorker.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
const timerState = {
intervalId: null,
startTime: null,
}
};

const sendTick = () => {
const elapsedTime = Date.now() - timerState.startTime
postMessage({ type: 'TICK', time: elapsedTime })
}
const elapsedTime = Date.now() - timerState.startTime;
postMessage({ type: "TICK", time: elapsedTime });
};

onmessage = (event) => {
const { type, startTime: receivedStartTime } = event.data
const { type, startTime: receivedStartTime } = event.data;
switch (type) {
case 'START':
case "START":
if (timerState.intervalId === null) {
timerState.startTime = receivedStartTime
timerState.intervalId = setInterval(sendTick, 1000)
timerState.startTime = receivedStartTime;
timerState.intervalId = setInterval(sendTick, 1000);
}
break
case 'RESET':
clearInterval(timerState.intervalId)
timerState.intervalId = null
timerState.startTime = null
break
break;
case "RESET":
clearInterval(timerState.intervalId);
timerState.intervalId = null;
timerState.startTime = null;
break;
default:
console.error('Unknown message type:', type)
console.error("Unknown message type:", type);
}
}
};
19 changes: 18 additions & 1 deletion public/vite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion tsconfig.node.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@
"moduleResolution": "bundler",
"allowSyntheticDefaultImports": true
},
"include": ["vite.config.ts"]
"include": [
"vite.config.ts"
]
}
10 changes: 5 additions & 5 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import react from '@vitejs/plugin-react-swc'
import { defineConfig } from 'vite'
import react from "@vitejs/plugin-react-swc";
import { defineConfig } from "vite";

// https://vitejs.dev/config/
export default defineConfig({
base: '.',
base: ".",
plugins: [react()],
resolve: {
alias: { '@/': `${process.cwd()}/src/` },
alias: { "@/": `${process.cwd()}/src/` },
},
server: {
// proxy: {
Expand All @@ -23,4 +23,4 @@ export default defineConfig({
// protocol: 'wss',
// },
},
})
});

0 comments on commit 6c6c9d4

Please sign in to comment.