feat: add Holo-work tracking, teams and board bonuses
Publish GitHub Pages output / publish (push) Successful in 30s

This commit is contained in:
2026-09-12 15:16:30 +09:00
parent cfea24f5f5
commit dd37f59565
25 changed files with 1237 additions and 33 deletions
@@ -0,0 +1,22 @@
import { writeFileSync } from 'node:fs';
import { prepareHolodoriDbSource, readHolodoriDbText } from './holodoridb-source.mjs';
const source = prepareHolodoriDbSource('kor');
const missions = JSON.parse(readHolodoriDbText(source, 'Mission.json')).map((row) => row.data)
.filter((mission) => mission.characterId
&& mission.categoryType === 'MissionCategoryType_MISSION_CATEGORY_TYPE_ACHIEVEMENT'
&& mission.type === 'MissionType_MISSION_TYPE_INCREMENT_WORK_FINISH_COUNT');
const progress = JSON.parse(readHolodoriDbText(source, 'MissionProgress.json')).map((row) => row.data);
if (!missions.length) throw new Error('No member Holo-work achievements found.');
const thresholdsByMember = Object.fromEntries(missions.sort((a, b) => a.characterId.localeCompare(b.characterId)).map((mission) => {
const thresholds = [...new Set(progress.filter((row) => row.missionId === mission.id).map((row) => Number(row.threshold)))].sort((a, b) => a - b);
if (!thresholds.length || thresholds.some((value) => !Number.isSafeInteger(value) || value <= 0)) {
throw new Error(`Invalid Holo-work thresholds: ${mission.id}`);
}
return [mission.characterId, thresholds];
}));
writeFileSync(new URL('../src/lib/data/holo-work-achievements.json', import.meta.url), JSON.stringify({
source: { repository: source.repository, commit: source.commit, files: ['Mission.json', 'MissionProgress.json'] },
thresholdsByMember
}, null, 2) + '\n');
console.log(`Collected Holo-work achievements for ${missions.length} members at ${source.commit}.`);