Skip to content

Commit

Permalink
chore: update CI scripts for beta (#707)
Browse files Browse the repository at this point in the history
* refactor: clean up old types

* chore: update ci scripts
  • Loading branch information
fribbels authored Nov 11, 2024
1 parent 3e48c1c commit 2b113fe
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 90 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: drearyquibbles

on:
push:
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/starrailoptimizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions src/lib/relics/relicScorerPotential.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -160,8 +159,8 @@ const possibleSubstats = new Set(Constants.SubStats)
export class RelicScorer {
characterRelicScoreMetas: Map<CharacterId, ScoringMetadata>
optimalPartScore: Map<Parts, Map<string, number>>
currentRelicScore: Map<GUID, Map<string, RelicScoringResult>>
futureRelicScore: Map<GUID, Map<string, FutureScoringResult>>
currentRelicScore: Map<RelicId, Map<string, RelicScoringResult>>
futureRelicScore: Map<RelicId, Map<string, FutureScoringResult>>

constructor() {
this.characterRelicScoreMetas = new Map()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
61 changes: 0 additions & 61 deletions src/types/common.d.ts
Original file line number Diff line number Diff line change
@@ -1,70 +1,9 @@
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
}

export type StringToNumberMap = {
[key: string]: number
}

export type StringToStringMap = {
[key: string]: string
}

export type StringToBooleanMap = {
[key: string]: string
}
4 changes: 2 additions & 2 deletions src/types/relic.d.ts
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -17,7 +17,7 @@ export type Relic = {
enhance: RelicEnhance
equippedBy: string | undefined
grade: RelicGrade
id: GUID
id: RelicId
verified?: boolean
ageIndex?: number

Expand Down
13 changes: 0 additions & 13 deletions src/types/relicSet.d.ts

This file was deleted.

0 comments on commit 2b113fe

Please sign in to comment.