diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index f48e243..063929c 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -7,8 +7,8 @@ on: jobs: publish: - # 커밋 메시지가 버전 범핑 포맷([skip ci] - (v...)) 일 때만 실행 - if: "contains(github.event.head_commit.message, '[skip ci] - (v')" + # 커밋 메시지가 버전 범핑 포맷([skip deploy] - (v...)) 일 때만 실행 + if: "contains(github.event.head_commit.message, '[skip deploy] - (v')" runs-on: ubuntu-latest permissions: contents: write diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bb11a38..62fc0b6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,7 @@ permissions: jobs: # Job 1: 변경사항 감지 및 PR 생성 prepare-release: - if: "!contains(github.event.head_commit.message, '[skip ci]')" + if: "!contains(github.event.head_commit.message, '[skip deploy]')" runs-on: ubuntu-latest steps: - name: Checkout code diff --git a/__tests__/kkuko/profile/components/ItemModal.test.tsx b/__tests__/kkuko/profile/components/ItemModal.test.tsx index f859dbd..ebbd902 100644 --- a/__tests__/kkuko/profile/components/ItemModal.test.tsx +++ b/__tests__/kkuko/profile/components/ItemModal.test.tsx @@ -39,7 +39,7 @@ describe('ItemModal', () => { expect(screen.getByText('장착 아이템 목록')).toBeInTheDocument(); expect(screen.getByText('Cool Hat')).toBeInTheDocument(); expect(screen.getByText('score:')).toBeInTheDocument(); - expect(screen.getByText('+10000')).toBeInTheDocument(); + expect(screen.getByText('+10')).toBeInTheDocument(); }); it('should call onClose when close button is clicked', () => { diff --git a/__tests__/kkuko/profile/utils/profileHelper.test.ts b/__tests__/kkuko/profile/utils/profileHelper.test.ts index cddc8d3..a0a2e2f 100644 --- a/__tests__/kkuko/profile/utils/profileHelper.test.ts +++ b/__tests__/kkuko/profile/utils/profileHelper.test.ts @@ -63,9 +63,9 @@ describe('profileHelper', () => { }); describe('formatNumber', () => { - it('should divide by 1000 and return string', () => { - expect(formatNumber(1500)).toBe('1.5'); - expect(formatNumber(10000)).toBe('10'); + it('should return string', () => { + expect(formatNumber(0.014999999)).toBe('0.015'); + expect(formatNumber(0.12)).toBe('0.12'); }); }); @@ -76,9 +76,9 @@ describe('profileHelper', () => { { id: '2', name: 'Item2', description: '', group: '', options: { str: 3 }, updatedAt: 1 } ]; const result = calculateTotalOptions(items); - // 1 * 1000 + 3 * 1000 = 4000 - expect(result['str']).toBe(4000); - expect(result['dex']).toBe(2000); + // 1 * 1 + 3 * 1 = 4 + expect(result['str']).toBe(4); + expect(result['dex']).toBe(2); }); it('should handle special options', () => { @@ -95,7 +95,7 @@ describe('profileHelper', () => { ]; const result = calculateTotalOptions(items); // Should use 'after' - expect(result['str']).toBe(5000); + expect(result['str']).toBe(5); }); it('should handle special options (before)', () => { @@ -112,7 +112,7 @@ describe('profileHelper', () => { ]; const result = calculateTotalOptions(items); // Should use 'before' - expect(result['str']).toBe(1000); + expect(result['str']).toBe(1); }); }); diff --git a/app/kkuko/profile/components/ItemModal.tsx b/app/kkuko/profile/components/ItemModal.tsx index ee49287..c6aa0a1 100644 --- a/app/kkuko/profile/components/ItemModal.tsx +++ b/app/kkuko/profile/components/ItemModal.tsx @@ -17,7 +17,7 @@ export default function ItemModal({ itemsData, profileData, onClose }: ItemModal const itemOptionUI = (key: string, value: number) => (
{getOptionName(key)}: - {value > 0 ? '+' : ''}{formatNumber(value * (key[0] === 'g' ? 100000 : 1000))}{key[0] === 'g' ? '%p' : ''} + {value > 0 ? '+' : ''}{formatNumber(value * (key[0] === 'g' ? 100 : 1))}{key[0] === 'g' ? '%p' : ''}
) @@ -71,7 +71,7 @@ export default function ItemModal({ itemsData, profileData, onClose }: ItemModal const imageGroup = getImageGroup(); return ( -
+
{/* Item Image */} {imageGroup && ( diff --git a/app/kkuko/profile/utils/profileHelper.ts b/app/kkuko/profile/utils/profileHelper.ts index 8546e98..cfc80f3 100644 --- a/app/kkuko/profile/utils/profileHelper.ts +++ b/app/kkuko/profile/utils/profileHelper.ts @@ -37,7 +37,7 @@ export const extractColorFromLabel = (description: string, isDarkTheme: boolean) }; export const formatNumber = (num: number): string => { - return (num / 1000).toString(); + return num.toFixed(3).replace(/\.?0+$/, ''); }; export const calculateTotalOptions = (itemsData: ItemInfo[]) => { @@ -48,13 +48,13 @@ export const calculateTotalOptions = (itemsData: ItemInfo[]) => { const relevantOptions = Date.now() >= item.options.date ? item.options.after : item.options.before; Object.entries(relevantOptions).forEach(([key, value]) => { if (value !== undefined && typeof value === 'number' && !isNaN(value)) { - totals[key] = (totals[key] || 0) + Number(value) * (key[0] === 'g' ? 100000 : 1000); + totals[key] = (totals[key] || 0) + Number(value) * (key[0] === 'g' ? 100 : 1); } }); } else { Object.entries(item.options).forEach(([key, value]) => { if (value !== undefined && typeof value === 'number' && !isNaN(value)) { - totals[key] = (totals[key] || 0) + Number(value) * (key[0] === 'g' ? 100000 : 1000); + totals[key] = (totals[key] || 0) + Number(value) * (key[0] === 'g' ? 100 : 1); } }); } diff --git a/scripts/release.js b/scripts/release.js index 19c3bfb..25da186 100644 --- a/scripts/release.js +++ b/scripts/release.js @@ -28,12 +28,12 @@ async function run() { console.log(`ℹ️ Current Version: v${currentVersion}`); - // 2. [skip ci] 체크 (PR 모드일 때만) + // 2. [skip deploy] 체크 (PR 모드일 때만) if (!isReleaseMode) { const log = await git.log({ maxCount: 1 }); const lastCommitMsg = log.latest.message; - if (lastCommitMsg.includes('[skip ci]')) { - console.log('🛑 Last commit contains [skip ci]. Exiting...'); + if (lastCommitMsg.includes('[skip ci]') || lastCommitMsg.includes('[skip deploy]')) { + console.log('🛑 Last commit contains [skip deploy]. Exiting...'); return; } } @@ -158,7 +158,7 @@ async function run() { // 8. Git 커밋 및 PR 생성 if (!isDryRun) { const branchName = `release/${nextVersion}`; - const commitMessage = `[skip ci] - (${nextVersion})`; + const commitMessage = `[skip deploy] - (${nextVersion})`; // Git 설정 await git.addConfig('user.name', 'github-actions[bot]'); diff --git a/vercel.json b/vercel.json index 8dab8bd..4c9f014 100644 --- a/vercel.json +++ b/vercel.json @@ -1,4 +1,4 @@ { "$schema": "https://openapi.vercel.sh/vercel.json", - "ignoreCommand": "git log -1 --pretty=%B | grep -q '\\[skip ci\\]'" + "ignoreCommand": "git log -1 --pretty=%B | grep -q '\\[skip deploy\\]'" } \ No newline at end of file