From 2b113fe023c3fc51ee2f205cccae055cfae23358 Mon Sep 17 00:00:00 2001 From: Fribbels Date: Sun, 10 Nov 2024 16:24:01 -0800 Subject: [PATCH] chore: update CI scripts for beta (#707) * refactor: clean up old types * chore: update ci scripts --- .../deploy-gh-pages.yml | 0 .../workflows/{ci.yml => drearyquibbles.yml} | 8 +-- .github/workflows/starrailoptimizer.yml | 6 +- src/lib/relics/relicScorerPotential.ts | 7 +-- .../CharacterConditionalsDisplay.tsx | 5 +- src/types/common.d.ts | 61 ------------------- src/types/relic.d.ts | 4 +- src/types/relicSet.d.ts | 13 ---- 8 files changed, 14 insertions(+), 90 deletions(-) rename .github/{beta => drearyquibbles}/deploy-gh-pages.yml (100%) rename .github/workflows/{ci.yml => drearyquibbles.yml} (91%) delete mode 100644 src/types/relicSet.d.ts diff --git a/.github/beta/deploy-gh-pages.yml b/.github/drearyquibbles/deploy-gh-pages.yml similarity index 100% rename from .github/beta/deploy-gh-pages.yml rename to .github/drearyquibbles/deploy-gh-pages.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/drearyquibbles.yml similarity index 91% rename from .github/workflows/ci.yml rename to .github/workflows/drearyquibbles.yml index 2dc68172e..66bdbaab6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/drearyquibbles.yml @@ -1,4 +1,4 @@ -name: CI +name: drearyquibbles on: push: @@ -27,19 +27,19 @@ jobs: with: find: "const BASE_PATH = '/hsr-optimizer'" replace: "const BASE_PATH = '/dreary-quibbles'" - include: "src/lib/db.ts" + include: "src/lib/state/db.ts" - name: Find and Replace API endpoint uses: jacobtomlinson/gha-find-replace@v3 with: find: "const API_ENDPOINT = 'https://o4b6dqwu5a.execute-api.us-east-1.amazonaws.com/prod'" replace: "const API_ENDPOINT = 'https://9di5b7zvtb.execute-api.us-west-2.amazonaws.com/prod'" - include: "src/components/RelicScorerTab.jsx" + include: "src/lib/tabs/tabShowcase/RelicScorerTab.jsx" - name: Find and Replace Beta header uses: jacobtomlinson/gha-find-replace@v3 with: find: "Fribbels Honkai Star Rail Optimizer" replace: "Fribbels Honkai Star Rail Optimizer (Beta)" - include: "src/components/LayoutHeader.tsx" + include: "src/lib/layout/LayoutHeader.tsx" - run: rm -rf .github/workflows - run: mv .github/beta .github/workflows - name: Pushes to another repository diff --git a/.github/workflows/starrailoptimizer.yml b/.github/workflows/starrailoptimizer.yml index 0185070d5..70bf0d2e5 100644 --- a/.github/workflows/starrailoptimizer.yml +++ b/.github/workflows/starrailoptimizer.yml @@ -29,19 +29,19 @@ jobs: with: find: "const BASE_PATH = '/hsr-optimizer'" replace: "const BASE_PATH = ''" - include: "src/lib/db.ts" + include: "src/lib/state/db.ts" - name: Find and Replace API endpoint uses: jacobtomlinson/gha-find-replace@v3 with: find: "const API_ENDPOINT = 'https://o4b6dqwu5a.execute-api.us-east-1.amazonaws.com/prod'" replace: "const API_ENDPOINT = 'https://9di5b7zvtb.execute-api.us-west-2.amazonaws.com/prod'" - include: "src/components/RelicScorerTab.jsx" + include: "src/lib/tabs/tabShowcase/RelicScorerTab.jsx" - name: Find and Replace officialOnly uses: jacobtomlinson/gha-find-replace@v3 with: find: "export const officialOnly = false" replace: "export const officialOnly = true" - include: "src/lib/constants.ts" + include: "src/lib/constants/constants.ts" - run: rm -rf .github/workflows - run: mv .github/starrailoptimizer .github/workflows - name: Pushes to another repository diff --git a/src/lib/relics/relicScorerPotential.ts b/src/lib/relics/relicScorerPotential.ts index 25bfc97cf..38268a3b3 100644 --- a/src/lib/relics/relicScorerPotential.ts +++ b/src/lib/relics/relicScorerPotential.ts @@ -4,8 +4,7 @@ import DB from 'lib/state/db' import { TsUtils } from 'lib/utils/TsUtils' import { Utils } from 'lib/utils/utils' import { Character, CharacterId } from 'types/character' -import { GUID } from 'types/common' -import { Relic, RelicEnhance, RelicGrade, Stat } from 'types/relic' +import { Relic, RelicEnhance, RelicGrade, RelicId, Stat } from 'types/relic' // FIXME HIGH @@ -160,8 +159,8 @@ const possibleSubstats = new Set(Constants.SubStats) export class RelicScorer { characterRelicScoreMetas: Map optimalPartScore: Map> - currentRelicScore: Map> - futureRelicScore: Map> + currentRelicScore: Map> + futureRelicScore: Map> constructor() { this.characterRelicScoreMetas = new Map() diff --git a/src/lib/tabs/tabOptimizer/conditionals/CharacterConditionalsDisplay.tsx b/src/lib/tabs/tabOptimizer/conditionals/CharacterConditionalsDisplay.tsx index b25bc72f6..9b721541f 100644 --- a/src/lib/tabs/tabOptimizer/conditionals/CharacterConditionalsDisplay.tsx +++ b/src/lib/tabs/tabOptimizer/conditionals/CharacterConditionalsDisplay.tsx @@ -6,11 +6,10 @@ import { HeaderText } from 'lib/ui/HeaderText' import { TooltipImage } from 'lib/ui/TooltipImage' import { memo } from 'react' import { useTranslation } from 'react-i18next' -import { Eidolon } from 'types/character' -import { DataMineId } from 'types/common' +import { CharacterId, Eidolon } from 'types/character' export interface CharacterConditionalDisplayProps { - id?: DataMineId + id?: CharacterId eidolon: Eidolon teammateIndex?: number } diff --git a/src/types/common.d.ts b/src/types/common.d.ts index 3c26d951f..c97c6fcd7 100644 --- a/src/types/common.d.ts +++ b/src/types/common.d.ts @@ -1,58 +1,5 @@ -export type DataMineId = string // "60012" -export type Unknown = unknown -export type LANGUAGE = - 'zh' | - 'de' | - 'en' | - 'es' | - 'fr' | - 'id' | - 'jp' | - 'kr' | - 'pt' | - 'ru' | - 'th' | - 'vi' export type GUID = string // TODO: match to GUID format -export type Rarity = 2 | 3 | 4 | 5 - -export type AssetRelativeUrl = string - -export type PathMap = { - Warrior: 'Destruction' - Warlock: 'Nihility' - Knight: 'Preservation' - Priest: 'Abundance' - Rogue: 'Hunt' - Shaman: 'Harmony' - Mage: 'Erudition' -} -export type InternalPath = keyof PathMap -export type ExternalPath = PathMap[InternalPath] - -export type Element = - 'Fire' | - 'Ice' | - 'Imaginary' | - 'Physical' | - 'Quantum' | - 'Thunder' | - 'Wind' - -export type Promotion = { - 'HP'?: number - 'ATK'?: number - 'CRIT Rate'?: number - 'CRIT DMG'?: number - 'DEF'?: number - 'SPD'?: number -} - -export type Promotions = { - [level: number]: Promotion -} - export type NumberToNumberMap = { [key: number]: number } @@ -60,11 +7,3 @@ export type NumberToNumberMap = { export type StringToNumberMap = { [key: string]: number } - -export type StringToStringMap = { - [key: string]: string -} - -export type StringToBooleanMap = { - [key: string]: string -} diff --git a/src/types/relic.d.ts b/src/types/relic.d.ts index fe69bceac..8c0999dbe 100644 --- a/src/types/relic.d.ts +++ b/src/types/relic.d.ts @@ -1,8 +1,8 @@ import { MainStats, Parts, Sets, StatsValues, SubStats } from 'lib/constants/constants' import { AugmentedStats } from 'lib/relics/relicAugmenter' import { RelicScoringWeights } from 'lib/tabs/tabRelics/RelicFilterBar' -import { GUID } from 'types/common' +export type RelicId = string export type RelicGrade = number export type RelicEnhance = number @@ -17,7 +17,7 @@ export type Relic = { enhance: RelicEnhance equippedBy: string | undefined grade: RelicGrade - id: GUID + id: RelicId verified?: boolean ageIndex?: number diff --git a/src/types/relicSet.d.ts b/src/types/relicSet.d.ts deleted file mode 100644 index df06182e6..000000000 --- a/src/types/relicSet.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { GUID } from 'types/common' - -export type RelicSet = { - id: GUID - name: string - desc: string[] - properties: [{ - type: string - value: number - }][] - icon: string - guide_overview: string[] -}