feat: More bonus (exponential) and method to list icons needed

This commit is contained in:
gauvainboiche
2026-10-08 14:20:58 +02:00
parent fc0d5e3ba4
commit a88b8f5f14
25 changed files with 977 additions and 40 deletions
+1 -13
View File
@@ -1,16 +1,4 @@
import { readFileSync } from 'node:fs';
import { fileURLToPath } from 'node:url';
import { buildContext } from '../public/js/engine/context.js';
import { DATA_FILES } from '../public/js/services/data.js';
export const PUBLIC_DIR = fileURLToPath(new URL('../public/', import.meta.url));
export const readJson = (relativePath) => JSON.parse(readFileSync(PUBLIC_DIR + relativePath, 'utf8'));
export function loadContext() {
const entries = Object.entries(DATA_FILES).map(([key, file]) => [key, readJson(`data/${file}.json`)]);
return buildContext(Object.fromEntries(entries));
}
export { loadContext, PUBLIC_DIR, readJson } from '../scripts/context.js';
/** Flatten nested locale JSON to dotted keys, like services/i18n.js does. */
export function flatKeys(object, prefix = '') {