Files
zellyy-finance/scripts/test-release.cjs
hansoo 8343b25439 feat: Stage 2 TypeScript 타입 안전성 개선 - any 타입 83개 → 62개 대폭 감소
 주요 개선사항:
- any 타입 83개에서 62개로 21개 수정 (25% 감소)
- 모든 ESLint 에러 11개 → 0개 완전 해결
- 타입 안전성 대폭 향상으로 런타임 오류 가능성 감소

🔧 수정된 파일들:
• PWADebug.tsx - 사용하지 않는 import들에 _ prefix 추가
• categoryUtils.ts - 불필요한 any 캐스트 제거
• TransactionsHeader.tsx - BudgetData 인터페이스 정의
• storageUtils.ts - generic 타입과 unknown 타입 적용
• 각종 error handler들 - Error | {message?: string} 타입 적용
• test 파일들 - 적절한 mock 인터페이스 정의
• 유틸리티 파일들 - any → unknown 또는 적절한 타입으로 교체

🏆 성과:
- 코드 품질 크게 향상 (280 → 80 문제로 71% 감소)
- TypeScript 컴파일러의 타입 체크 효과성 증대
- 개발자 경험 개선 (IDE 자동완성, 타입 추론 등)

🧹 추가 정리:
- ESLint no-console/no-alert 경고 해결
- Prettier 포맷팅 적용으로 코드 스타일 통일

🎯 다음 단계: 남은 62개 any 타입 계속 개선 예정

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-14 10:08:51 +09:00

84 lines
2.5 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env node
const { execSync } = require("child_process");
const fs = require("fs");
const path = require("path");
/**
* 릴리즈 시스템 테스트 스크립트
* Semantic Release 동작을 시뮬레이션합니다.
*/
console.log("🧪 Testing release system...\n");
const projectRoot = path.join(__dirname, "..");
try {
// 1. Git 상태 확인
console.log("1⃣ Checking git status...");
const gitStatus = execSync("git status --porcelain", {
cwd: projectRoot,
encoding: "utf8",
});
if (gitStatus.trim()) {
console.log("⚠️ Warning: Working directory has uncommitted changes");
console.log(gitStatus);
} else {
console.log("✅ Working directory is clean");
}
// 2. 현재 버전 확인
console.log("\n2⃣ Checking current version...");
const packageJson = JSON.parse(
fs.readFileSync(path.join(projectRoot, "package.json"), "utf8")
);
console.log(`📦 Current version: ${packageJson.version}`);
// 3. 커밋 메시지 분석
console.log("\n3⃣ Analyzing recent commits...");
const commits = execSync('git log --oneline --since="1 day ago"', {
cwd: projectRoot,
encoding: "utf8",
});
if (commits.trim()) {
console.log("Recent commits:");
console.log(commits);
} else {
console.log("📝 No recent commits found");
}
// 4. Semantic Release 드라이런
console.log("\n4⃣ Running semantic-release dry run...");
try {
const dryRunOutput = execSync("npx semantic-release --dry-run", {
cwd: projectRoot,
encoding: "utf8",
env: { ...process.env, GITHUB_TOKEN: "dummy" },
});
console.log("🎯 Semantic release analysis:");
console.log(dryRunOutput);
} catch (error) {
console.log(" Semantic release dry run output:");
console.log(error.stdout || error.message);
}
// 5. 버전 동기화 테스트
console.log("\n5⃣ Testing version synchronization...");
execSync("npm run version:check", { stdio: "inherit", cwd: projectRoot });
// 6. 빌드 테스트
console.log("\n6⃣ Testing build process...");
execSync("npm run build:prod", { stdio: "inherit", cwd: projectRoot });
console.log("✅ Build completed successfully");
console.log("\n🎉 Release system test completed successfully!");
console.log("\n📋 Test Summary:");
console.log("- Git status: ✅");
console.log("- Version consistency: ✅");
console.log("- Semantic release: ✅");
console.log("- Build process: ✅");
} catch (error) {
console.error("\n❌ Test failed:", error.message);
process.exit(1);
}