feat: Add CI/CD pipeline and code quality improvements
- Add GitHub Actions workflow for automated CI/CD - Configure Node.js 18.x and 20.x matrix testing - Add TypeScript type checking step - Add ESLint code quality checks with enhanced rules - Add Prettier formatting verification - Add production build validation - Upload build artifacts for deployment - Set up automated testing on push/PR - Replace console.log with environment-aware logger - Add pre-commit hooks for code quality - Exclude archive folder from linting 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
|
||||
import { checkNetworkStatus } from '@/utils/network/checker';
|
||||
import { toast } from '@/hooks/useToast.wrapper';
|
||||
import { checkNetworkStatus } from "@/utils/network/checker";
|
||||
import { syncLogger } from "@/utils/logger";
|
||||
import { toast } from "@/hooks/useToast.wrapper";
|
||||
|
||||
/**
|
||||
* 동기화를 위한 네트워크 상태 확인
|
||||
@@ -8,20 +8,27 @@ import { toast } from '@/hooks/useToast.wrapper';
|
||||
export const checkSyncNetworkStatus = async (): Promise<boolean> => {
|
||||
// 기본 네트워크 상태 확인 - navigator.onLine 우선 사용
|
||||
const navigatorOnline = navigator.onLine;
|
||||
console.log(`[동기화] 기본 네트워크 상태 확인: ${navigatorOnline ? '온라인' : '오프라인'}`);
|
||||
|
||||
syncLogger.info(
|
||||
`[동기화] 기본 네트워크 상태 확인: ${navigatorOnline ? "온라인" : "오프라인"}`
|
||||
);
|
||||
|
||||
if (!navigatorOnline) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// 강화된 네트워크 확인 시도 (실패해도 계속 진행)
|
||||
try {
|
||||
const isOnline = await checkNetworkStatus();
|
||||
console.log(`[동기화] 강화된 네트워크 확인 결과: ${isOnline ? '온라인' : '오프라인'}`);
|
||||
syncLogger.info(
|
||||
`[동기화] 강화된 네트워크 확인 결과: ${isOnline ? "온라인" : "오프라인"}`
|
||||
);
|
||||
return isOnline;
|
||||
} catch (error) {
|
||||
// 네트워크 확인 실패해도 navigator.onLine이 true면 진행
|
||||
console.warn('[동기화] 강화된 네트워크 확인 실패, 기본 상태 사용:', error);
|
||||
syncLogger.warn(
|
||||
"[동기화] 강화된 네트워크 확인 실패, 기본 상태 사용:",
|
||||
error
|
||||
);
|
||||
return navigatorOnline;
|
||||
}
|
||||
};
|
||||
@@ -34,12 +41,12 @@ export const showNetworkErrorNotification = (
|
||||
) => {
|
||||
const title = "네트워크 연결 필요";
|
||||
const description = "동기화를 위해 인터넷 연결이 필요합니다.";
|
||||
|
||||
|
||||
toast({
|
||||
title,
|
||||
description,
|
||||
variant: "destructive"
|
||||
variant: "destructive",
|
||||
});
|
||||
|
||||
|
||||
addNotification(title, description);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user