Skip to content

Commit

Permalink
Fix misc issues (#1383)
Browse files Browse the repository at this point in the history
* Add Hu Tao atk optimization target

* Make Song of Days Past a teambuff

* Update scanner versions

* Remove Akasha scanner

* Add Song of Days past as optimization target

* Modify SyncRepo to take a parameter for branch name

* Remove Song of Days Past opt target
  • Loading branch information
nguyentvan7 authored Dec 26, 2023
1 parent cd4a401 commit e9f8659
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 19 deletions.
15 changes: 10 additions & 5 deletions apps/frontend/src/app/Data/Artifacts/SongOfDaysPast/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,15 @@ const burst_dmgInc = { ...healing_dmgInc }
export const data: Data = dataObjForArtifactSheet(key, {
premod: {
heal_: set2,
normal_dmgInc,
charged_dmgInc,
plunging_dmgInc,
skill_dmgInc,
burst_dmgInc,
},
teamBuff: {
premod: {
normal_dmgInc,
charged_dmgInc,
plunging_dmgInc,
skill_dmgInc,
burst_dmgInc,
},
},
})

Expand All @@ -54,6 +58,7 @@ const sheet: IArtifactSheet = {
value: condHealing,
path: condHealingPath,
name: trm('condName'),
teamBuff: true,
states: objKeyMap(healingArr, (heal) => ({
name: `${heal}`,
fields: [
Expand Down
1 change: 1 addition & 0 deletions apps/frontend/src/app/Data/Characters/HuTao/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ const dmgFormulas = {
),
skill: {
dmg: dmgNode('atk', dm.skill.dmg, 'skill'),
atk,
},
burst: {
dmg: dmgNode('atk', dm.burst.dmg, 'burst'),
Expand Down
18 changes: 8 additions & 10 deletions apps/frontend/src/app/PageScanner/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { AnvilIcon, DiscordIcon } from '@genshin-optimizer/svgicons'
import { CardThemed, SqBadge } from '@genshin-optimizer/ui-common'
import {
Backpack,
Computer,
Download,
EmojiEvents,
Gamepad,
InsertLink,
PersonSearch,
Expand All @@ -27,10 +27,8 @@ import ReactGA from 'react-ga4'
import { Trans, useTranslation } from 'react-i18next'
import { Link as RouterLink } from 'react-router-dom'
import AdScanner from './AdeptiScanner.png'
import AkashaScanner from './AkashaScanner.png'
import Artiscan from './artiscan.png'
import GIScanner from './GIScanner.png'
import { CardThemed, SqBadge } from '@genshin-optimizer/ui-common'
import Artiscan from './artiscan.png'
export default function PageScanner() {
const { t } = useTranslation('page_scanner')
ReactGA.send({ hitType: 'pageview', page: '/scanner' })
Expand Down Expand Up @@ -98,7 +96,7 @@ export default function PageScanner() {
sx={{ display: 'flex', alignItems: 'center' }}
>
<Gamepad sx={{ pr: 0.5 }} />
4.2
4.3
</SqBadge>
<SqBadge sx={{ display: 'flex', alignItems: 'center' }}>
<Computer sx={{ pr: 0.5 }} />
Expand Down Expand Up @@ -156,7 +154,7 @@ export default function PageScanner() {
sx={{ display: 'flex', alignItems: 'center' }}
>
<Gamepad sx={{ pr: 0.5 }} />
4.2
4.3
</SqBadge>
<SqBadge sx={{ display: 'flex', alignItems: 'center' }}>
<Computer sx={{ pr: 0.5 }} />
Expand Down Expand Up @@ -243,7 +241,7 @@ export default function PageScanner() {
sx={{ display: 'flex', alignItems: 'center' }}
>
<Gamepad sx={{ pr: 0.5 }} />
4.2
4.3
</SqBadge>
<SqBadge sx={{ display: 'flex', alignItems: 'center' }}>
<Computer sx={{ pr: 0.5 }} />
Expand Down Expand Up @@ -295,7 +293,7 @@ export default function PageScanner() {
</CardContent>
</CardThemed>
</Grid>
<Grid item xs={1}>
{/* <Grid item xs={1}>
<CardThemed sx={{ height: '100%' }}>
<CardActionArea
href="https://github.com/xenesty/AkashaScanner"
Expand Down Expand Up @@ -323,7 +321,7 @@ export default function PageScanner() {
sx={{ display: 'flex', gap: 1, py: 1, flexWrap: 'wrap' }}
>
<SqBadge
color="success"
color="warning"
sx={{ display: 'flex', alignItems: 'center' }}
>
<Gamepad sx={{ pr: 0.5 }} />
Expand Down Expand Up @@ -383,7 +381,7 @@ export default function PageScanner() {
</Typography>
</CardContent>
</CardThemed>
</Grid>
</Grid> */}
</Grid>
</Box>
)
Expand Down
3 changes: 2 additions & 1 deletion libs/dm/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"load-dm": {
"options": {
"repoUrl": "https://gitlab.com/Dimbreath/AnimeGameData.git",
"outputPath": "libs/dm/GenshinData"
"outputPath": "libs/dm/GenshinData",
"branch": "origin/main"
},
"inputs": [
{
Expand Down
3 changes: 3 additions & 0 deletions libs/plugin/src/executors/sync-repo/executor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ describe('SyncRepo Executor', () => {
const repoUrl = 'https://github.com/chrislgarry/Apollo-11/'
const outputPath = path.join(__dirname, 'TestDB')
const hashPath = path.join(__dirname, 'TestDB.hash')
const branch = 'origin/master'

if (fs.existsSync(outputPath))
fs.rmSync(outputPath, { recursive: true, force: true })
Expand All @@ -15,6 +16,7 @@ describe('SyncRepo Executor', () => {
const output1 = await executor({
repoUrl,
outputPath,
branch,
prefixPath: false,
})

Expand All @@ -28,6 +30,7 @@ describe('SyncRepo Executor', () => {
const output2 = await executor({
repoUrl,
outputPath,
branch,
prefixPath: false,
})
expect(output2.success).toBe(true)
Expand Down
9 changes: 7 additions & 2 deletions libs/plugin/src/executors/sync-repo/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ import * as path from 'path'
export default async function runExecutor(
options: SyncRepoExecutorSchema
): Promise<{ success: boolean }> {
const { outputPath, repoUrl: url, prefixPath: prefix = true } = options
const {
outputPath,
repoUrl: url,
prefixPath: prefix = true,
branch,
} = options
const cwd = prefix ? path.join(workspaceRoot, outputPath) : outputPath
const remoteHash = getRemoteRepoHash(url)
const name = path.basename(cwd)
Expand All @@ -23,7 +28,7 @@ Caution: if this is part of nx cache replay,
const localHash = getLocalRepoHash(cwd)
if (remoteHash !== localHash) {
execSync(`git fetch --depth 1`, { cwd })
execSync(`git reset --hard origin/master`, { cwd })
execSync(`git reset --hard ${branch}`, { cwd })
} else console.log('Repo already existed with the latest commit')
} else {
// Clone
Expand Down
1 change: 1 addition & 0 deletions libs/plugin/src/executors/sync-repo/schema.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export interface SyncRepoExecutorSchema {
repoUrl: string
outputPath: string
branch: string
prefixPath?: boolean
}
4 changes: 4 additions & 0 deletions libs/plugin/src/executors/sync-repo/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
"type": "string",
"description": "Local repo path (including the repo name)"
},
"branch": {
"type": "string",
"description": "Branch to sync (e.g. origin/master)"
},
"prefixPath": {
"type": "boolean",
"description": "Whether to prepend `localPath` with `{workspaceRoot}`. Default: true"
Expand Down
3 changes: 2 additions & 1 deletion libs/sr-dm/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"load-dm": {
"options": {
"repoUrl": "https://github.com/Dimbreath/StarRailData.git",
"outputPath": "libs/sr-dm/StarRailData"
"outputPath": "libs/sr-dm/StarRailData",
"branch": "origin/master"
},
"inputs": [
{
Expand Down

0 comments on commit e9f8659

Please sign in to comment.