diff --git a/README.md b/README.md index 23437b0..9a01d69 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,22 @@ # Rhodes Database + The database of Rhodes Island, open to anyone to access! Rhodes Database is a collection of tools for [Arknights](https://arknights.global). # Minimal JavaScript + Rhodes Database aims to avoid JavaScript anywhere possible. Core features (listed below) are guaranteed to have 0 JavaScript delivered to your browser when they are loaded. This provides an extremely lightweight, fast and smooth experience. The core features are: -- Operator information -- Depot -- Enemies archive + +- Operator information +- Depot +- Enemies archive Side features that may have JavaScript: -- Planner - - Requires JavaScript to function. No other way around it ): -- Story reader - - Only requires JavaScript to change Doctor's name. It functions perfectly fine otherwise. + +- Planner + - Requires JavaScript to function. No other way around it ): +- Story reader + - Only requires JavaScript to change Doctor's name. It functions perfectly fine otherwise. diff --git a/postcss.config.js b/postcss.config.js index 1a52624..35237eb 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -1,6 +1,6 @@ export default { plugins: { tailwindcss: {}, - autoprefixer: {}, - }, + autoprefixer: {} + } } diff --git a/src/lib/constants.ts b/src/lib/constants.ts index 76deefc..eabd926 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -18,5 +18,5 @@ export const SERVER_TO_LANGCODE_MAP: { [region: string]: string } = { en: "en_US", cn: "zh_CN", jp: "ja_JP", - kr: "ko_KR", + kr: "ko_KR" } diff --git a/src/lib/logic/depot.ts b/src/lib/logic/depot.ts index b0f62d4..65d6752 100644 --- a/src/lib/logic/depot.ts +++ b/src/lib/logic/depot.ts @@ -5,7 +5,7 @@ import { ASSETS_REPO, SERVER_TO_LANGCODE_MAP, SERVERS, - ASSETS_PATH, + ASSETS_PATH } from "$lib/constants" import type { GHContent, GHTrees } from "$lib/types" @@ -50,7 +50,7 @@ for (const region of SERVERS) { const rawTable = JSON.parse( ( await fs.readFile(`${GAMEDATA_PATH}/${langCode}/gamedata/excel/item_table.json`) - ).toString(), + ).toString() ) as RawItemTable for (const rawItem of Object.values(rawTable.items)) { @@ -64,7 +64,7 @@ export const IconPaths: { [k: string]: string } = {} { const response = (await ( await fetchWithAuth( - `https://api.github.com/repos/${ASSETS_REPO}/contents/${ASSETS_PATH}/arts/items`, + `https://api.github.com/repos/${ASSETS_REPO}/contents/${ASSETS_PATH}/arts/items` ) ).json()) as GHContent[] @@ -72,7 +72,7 @@ export const IconPaths: { [k: string]: string } = {} const tree = (await ( await fetchWithAuth( - `https://api.github.com/repos/${ASSETS_REPO}/git/trees/${sha}?recursive=1`, + `https://api.github.com/repos/${ASSETS_REPO}/git/trees/${sha}?recursive=1` ) ).json()) as GHTrees @@ -87,7 +87,7 @@ export const IconPaths: { [k: string]: string } = {} { const response = (await ( await fetchWithAuth( - `https://api.github.com/repos/${ASSETS_REPO}/contents/${ASSETS_PATH}/activity/commonassets/`, + `https://api.github.com/repos/${ASSETS_REPO}/contents/${ASSETS_PATH}/activity/commonassets/` ) ).json()) as GHContent[] @@ -95,7 +95,7 @@ export const IconPaths: { [k: string]: string } = {} const tree = (await ( await fetchWithAuth( - `https://api.github.com/repos/${ASSETS_REPO}/git/trees/${sha}?recursive=1`, + `https://api.github.com/repos/${ASSETS_REPO}/git/trees/${sha}?recursive=1` ) ).json()) as GHTrees diff --git a/src/lib/logic/enemies.ts b/src/lib/logic/enemies.ts index 9d8de39..1f7cdbb 100644 --- a/src/lib/logic/enemies.ts +++ b/src/lib/logic/enemies.ts @@ -5,7 +5,7 @@ import { ASSETS_REPO, SERVER_TO_LANGCODE_MAP, SERVERS, - ASSETS_PATH, + ASSETS_PATH } from "$lib/constants" import type { GHContent, GHTrees } from "$lib/types" @@ -119,17 +119,17 @@ for (const region of SERVERS) { const rawHandbook = JSON.parse( ( await fs.readFile( - `${GAMEDATA_PATH}/${langCode}/gamedata/excel/enemy_handbook_table.json`, + `${GAMEDATA_PATH}/${langCode}/gamedata/excel/enemy_handbook_table.json` ) - ).toString(), + ).toString() ) as RawHandbookTable const rawTable = JSON.parse( ( await fs.readFile( - `${GAMEDATA_PATH}/${langCode}/gamedata/levels/enemydata/enemy_database.json`, + `${GAMEDATA_PATH}/${langCode}/gamedata/levels/enemydata/enemy_database.json` ) - ).toString(), + ).toString() ) as RawDatabaseTable RaceData[region] = rawHandbook.raceData @@ -140,7 +140,7 @@ for (const region of SERVERS) { const rawHandbookEnemy = rawHandbook.enemyData[rawEnemyData.Key] || { enemyIndex: "", sortId: Number.parseInt(idx) + largestSortId, - abilityList: [], + abilityList: [] } const levels: ParsedEnemyLevels = [] @@ -150,7 +150,7 @@ for (const region of SERVERS) { const attributes: ParsedAttributes = { lifePointReduce: rawLevel.enemyData.lifePointReduce.m_defined ? rawLevel.enemyData.lifePointReduce.m_value - : rawLevel0.enemyData.lifePointReduce.m_value, + : rawLevel0.enemyData.lifePointReduce.m_value } for (const [attrKey, attrVal] of Object.entries(rawLevel.enemyData.attributes)) { @@ -170,7 +170,7 @@ for (const region of SERVERS) { priority: rawSkill.priority, cooldown: rawSkill.cooldown, initCooldown: rawSkill.initCooldown, - spCost: rawSkill.spCost, + spCost: rawSkill.spCost } if (rawSkill.blackboard) { @@ -185,7 +185,7 @@ for (const region of SERVERS) { levels.push({ attributes: attributes, talentBlackboard: rawLevel.enemyData.talentBlackboard || [], - skills: parsedSkills, + skills: parsedSkills }) } @@ -201,7 +201,7 @@ for (const region of SERVERS) { sortId: rawHandbookEnemy.sortId, abilities: rawHandbookEnemy.abilityList, - levels: levels, + levels: levels } } } @@ -212,7 +212,7 @@ export const IconPaths: { [k: string]: string } = {} { const response = (await ( await fetchWithAuth( - `https://api.github.com/repos/${ASSETS_REPO}/contents/${ASSETS_PATH}/arts`, + `https://api.github.com/repos/${ASSETS_REPO}/contents/${ASSETS_PATH}/arts` ) ).json()) as GHContent[] @@ -220,7 +220,7 @@ export const IconPaths: { [k: string]: string } = {} const tree = (await ( await fetchWithAuth( - `https://api.github.com/repos/${ASSETS_REPO}/git/trees/${sha}?recursive=1`, + `https://api.github.com/repos/${ASSETS_REPO}/git/trees/${sha}?recursive=1` ) ).json()) as GHTrees diff --git a/src/lib/logic/operators.ts b/src/lib/logic/operators.ts index a8d999a..4789ed6 100644 --- a/src/lib/logic/operators.ts +++ b/src/lib/logic/operators.ts @@ -5,7 +5,7 @@ import { ASSETS_REPO, ASSETS_BRANCH, SERVER_TO_LANGCODE_MAP, - SERVERS, + SERVERS } from "$lib/constants" import type { BlackboardEntry } from "$lib/types" @@ -113,13 +113,13 @@ for (const region of SERVERS) { const rawCharTable = JSON.parse( ( await fs.readFile(`${GAMEDATA_PATH}/${langCode}/gamedata/excel/character_table.json`) - ).toString(), + ).toString() ) as RawCharacterTable const RawSkillTable = JSON.parse( ( await fs.readFile(`${GAMEDATA_PATH}/${langCode}/gamedata/excel/skill_table.json`) - ).toString(), + ).toString() ) as RawSkillTable for (const [charId, rawChar] of Object.entries(rawCharTable)) { @@ -146,7 +146,7 @@ for (const region of SERVERS) { name: rawSkillData.levels[0].name, levels: rawSkillData.levels, - masteryCosts: rawCharSkill.levelUpCostCond, + masteryCosts: rawCharSkill.levelUpCostCond }) } } @@ -166,7 +166,7 @@ for (const region of SERVERS) { profession: rawChar.profession, subProfession: rawChar.subProfessionId, - skills: skills, + skills: skills } Data[region][charId] = parsedChar diff --git a/src/lib/logic/richtext.ts b/src/lib/logic/richtext.ts index 18395c1..d6f3974 100644 --- a/src/lib/logic/richtext.ts +++ b/src/lib/logic/richtext.ts @@ -24,7 +24,7 @@ export function ParseRichtextToNodes(text: string): RichtextNode[] { alwaysCreateTextNode: true, trimValues: false, parseAttributeValue: false, - parseTagValue: false, + parseTagValue: false }) const nodes: RichtextNode[] = [] @@ -37,8 +37,8 @@ export function ParseRichtextToNodes(text: string): RichtextNode[] { const nodeData: RichtextNode = structuredClone( parentNodeData || { text: "", - formatters: [], - }, + formatters: [] + } ) if (key === "#text") { diff --git a/src/localization/en.json b/src/localization/en.json index 2e4dd38..86f1e4b 100644 --- a/src/localization/en.json +++ b/src/localization/en.json @@ -1,15 +1,15 @@ { - "depot": "Depot", - "enemies": "Enemies", - "glossary": "Glossary", - "operators": "Operators", + "depot": "Depot", + "enemies": "Enemies", + "glossary": "Glossary", + "operators": "Operators", - "level": "Level", - "level_plural": "Levels", + "level": "Level", + "level_plural": "Levels", - "description": "Description", - "duration": "Duration", - "init_sp": "Initial SP", - "sp_cost": "SP Cost", - "blackboard": "Blackboard" -} \ No newline at end of file + "description": "Description", + "duration": "Duration", + "init_sp": "Initial SP", + "sp_cost": "SP Cost", + "blackboard": "Blackboard" +} diff --git a/src/routes/[region]/+layout.server.ts b/src/routes/[region]/+layout.server.ts index 938c444..c61c28a 100644 --- a/src/routes/[region]/+layout.server.ts +++ b/src/routes/[region]/+layout.server.ts @@ -23,14 +23,14 @@ for (const region of SERVERS) { const rawTable = JSON.parse( ( await fs.readFile( - `${GAMEDATA_PATH}/${SERVER_TO_LANGCODE_MAP[region]}/gamedata/excel/gamedata_const.json`, + `${GAMEDATA_PATH}/${SERVER_TO_LANGCODE_MAP[region]}/gamedata/excel/gamedata_const.json` ) - ).toString(), + ).toString() ) as RawGamedataConst GamedataConst[region] = { richTextStyles: rawTable.richTextStyles, - termDescriptionDict: rawTable.termDescriptionDict, + termDescriptionDict: rawTable.termDescriptionDict } } @@ -40,6 +40,6 @@ export function load({ params }) { return { richtextTable: GamedataConst[params.region], strings: localizationTable, - region: params.region, + region: params.region } } diff --git a/src/routes/[region]/depot/+page.server.ts b/src/routes/[region]/depot/+page.server.ts index b6e11c2..535edef 100644 --- a/src/routes/[region]/depot/+page.server.ts +++ b/src/routes/[region]/depot/+page.server.ts @@ -3,6 +3,6 @@ import { IconPaths, Data } from "$lib/logic/depot" export function load({ params }) { return { itemTable: Data[params.region], - iconPaths: IconPaths, + iconPaths: IconPaths } } diff --git a/src/routes/[region]/depot/[itemId]/+page.server.ts b/src/routes/[region]/depot/[itemId]/+page.server.ts index 4c7008e..0daec0f 100644 --- a/src/routes/[region]/depot/[itemId]/+page.server.ts +++ b/src/routes/[region]/depot/[itemId]/+page.server.ts @@ -14,7 +14,7 @@ export async function load({ params }) { rarity: itemData.rarity, itemId: itemData.itemId, - iconUrl: iconUrl, + iconUrl: iconUrl } } @@ -25,7 +25,7 @@ export async function entries() { for (const itemId of Object.keys(Data[region])) { returns.push({ itemId: itemId, - region: region, + region: region }) } } diff --git a/src/routes/[region]/enemies/+page.server.ts b/src/routes/[region]/enemies/+page.server.ts index 1cc37b9..f13693e 100644 --- a/src/routes/[region]/enemies/+page.server.ts +++ b/src/routes/[region]/enemies/+page.server.ts @@ -3,6 +3,6 @@ import { Data, IconPaths } from "$lib/logic/enemies" export function load({ params }) { return { enemiesTable: Data[params.region], - iconPaths: IconPaths, + iconPaths: IconPaths } } diff --git a/src/routes/[region]/enemies/[enemyId]/+page.server.ts b/src/routes/[region]/enemies/[enemyId]/+page.server.ts index a8fc434..8182f86 100644 --- a/src/routes/[region]/enemies/[enemyId]/+page.server.ts +++ b/src/routes/[region]/enemies/[enemyId]/+page.server.ts @@ -23,7 +23,7 @@ export async function load({ params }) { levels: enemyData.levels, iconUrl: iconUrl, - types: types, + types: types } } @@ -34,7 +34,7 @@ export async function entries() { for (const enemy of Object.values(Data[region])) { returns.push({ enemyId: enemy.enemyId, - region: region, + region: region }) } } diff --git a/src/routes/[region]/operators/+page.server.ts b/src/routes/[region]/operators/+page.server.ts index 76bb570..6b42a1f 100644 --- a/src/routes/[region]/operators/+page.server.ts +++ b/src/routes/[region]/operators/+page.server.ts @@ -2,6 +2,6 @@ import { Data } from "$lib/logic/operators" export function load({ params }) { return { - charTable: Data[params.region], + charTable: Data[params.region] } } diff --git a/src/routes/[region]/operators/[charId]/+page.server.ts b/src/routes/[region]/operators/[charId]/+page.server.ts index 3b2ff27..aa4c6ca 100644 --- a/src/routes/[region]/operators/[charId]/+page.server.ts +++ b/src/routes/[region]/operators/[charId]/+page.server.ts @@ -2,6 +2,6 @@ import { Data } from "$lib/logic/operators" export function load({ params }) { return { - charData: Data[params.region][params.charId], + charData: Data[params.region][params.charId] } } diff --git a/svelte.config.js b/svelte.config.js index 10bca61..37f27d5 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -13,9 +13,9 @@ const config = { // See https://kit.svelte.dev/docs/adapters for more information about adapters. adapter: adapter({}), alias: { - $src: "src", - }, - }, + $src: "src" + } + } } export default config diff --git a/tailwind.config.js b/tailwind.config.js index 92f3086..706c73d 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -2,7 +2,7 @@ export default { content: ["src/**/*.{html,js,ts,svelte}"], theme: { - extend: {}, + extend: {} }, - plugins: [], + plugins: [] } diff --git a/vite.config.ts b/vite.config.ts index 8a943c5..afa40c3 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -4,5 +4,5 @@ import tailwindcss from "@tailwindcss/vite" import { defineConfig } from "vite" export default defineConfig({ - plugins: [sveltekit(), tailwindcss()], + plugins: [sveltekit(), tailwindcss()] })