Skip to content
Merged

1.6.2 #137

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
4 changes: 2 additions & 2 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion __tests__/kkuko/profile/components/ItemModal.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
16 changes: 8 additions & 8 deletions __tests__/kkuko/profile/utils/profileHelper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
});

Expand All @@ -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', () => {
Expand All @@ -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)', () => {
Expand All @@ -112,7 +112,7 @@ describe('profileHelper', () => {
];
const result = calculateTotalOptions(items);
// Should use 'before'
expect(result['str']).toBe(1000);
expect(result['str']).toBe(1);
});
});

Expand Down
4 changes: 2 additions & 2 deletions app/kkuko/profile/components/ItemModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default function ItemModal({ itemsData, profileData, onClose }: ItemModal
const itemOptionUI = (key: string, value: number) => (
<div key={key} className="bg-gray-50 dark:bg-gray-700 rounded px-3 py-2">
<span className="text-sm text-gray-600 dark:text-gray-400">{getOptionName(key)}: </span>
<span className="font-semibold text-gray-900 dark:text-gray-100">{value > 0 ? '+' : ''}{formatNumber(value * (key[0] === 'g' ? 100000 : 1000))}{key[0] === 'g' ? '%p' : ''}</span>
<span className="font-semibold text-gray-900 dark:text-gray-100">{value > 0 ? '+' : ''}{formatNumber(value * (key[0] === 'g' ? 100 : 1))}{key[0] === 'g' ? '%p' : ''}</span>
</div>
)

Expand Down Expand Up @@ -71,7 +71,7 @@ export default function ItemModal({ itemsData, profileData, onClose }: ItemModal
const imageGroup = getImageGroup();

return (
<div key={item.id} className="border border-gray-200 dark:border-gray-700 rounded-lg p-4">
<div key={`${item.id}::${equipment?.slot}`} className="border border-gray-200 dark:border-gray-700 rounded-lg p-4">
<div className="flex gap-4">
{/* Item Image */}
{imageGroup && (
Expand Down
6 changes: 3 additions & 3 deletions app/kkuko/profile/utils/profileHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[]) => {
Expand All @@ -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);
}
});
}
Expand Down
8 changes: 4 additions & 4 deletions scripts/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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]');
Expand Down
2 changes: 1 addition & 1 deletion vercel.json
Original file line number Diff line number Diff line change
@@ -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\\]'"
}