Skip to content

Commit

Permalink
Merge d17160b into 3ffb281
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyentvan7 authored Dec 16, 2023
2 parents 3ffb281 + d17160b commit 018b123
Show file tree
Hide file tree
Showing 24 changed files with 131 additions and 69 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/deploy-go-pando-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ on:
- 'apps/sr-frontend-e2e/**'
- 'libs/sr-assets/**'
- 'libs/sr-consts/**'
- 'libs/sr-data/**'
- 'libs/sr-db/**'
- 'libs/sr-dm/**'
- 'libs/sr-formula/**'
- 'libs/sr-stats/**'
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/deploy-go-wr-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ on:
- 'apps/sr-frontend-e2e/**'
- 'libs/sr-assets/**'
- 'libs/sr-consts/**'
- 'libs/sr-data/**'
- 'libs/sr-db/**'
- 'libs/sr-dm/**'
- 'libs/sr-formula/**'
- 'libs/sr-stats/**'
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/deploy-sro-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,21 @@ on:
- 'apps/gi-frontend-e2e/**'
- 'apps/frontend/**'
- 'apps/frontend-e2e/**'
- 'libs/consts/**'
- 'libs/dm/**'
- 'libs/gi-art-scanner/**'
- 'libs/gi-assets/**'
- 'libs/gi-consts/**'
- 'libs/gi-dm-localization/**'
- 'libs/gi-formula/**'
- 'libs/gi-formula-ui/**'
- 'libs/gi-good/**'
- 'libs/gi-localization/**'
- 'libs/gi-stats/**'
- 'libs/gi-svgicons/**'
- 'libs/gi-util/**'
- 'libs/gi-ui/**'
- 'libs/gi-util/**'
- 'libs/silly-wisher/**'
- 'libs/silly-wisher-names/**'
types: [opened, reopened, synchronize, labeled]

jobs:
Expand Down
1 change: 1 addition & 0 deletions libs/sr-consts/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ export * from './character'
export * from './common'
export * from './lightCone'
export * from './relic'
export * from './sro'
2 changes: 2 additions & 0 deletions libs/sr-consts/src/sro.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const allHitModeKeys = ['hit', 'avgHit', 'critHit'] as const
export type HitModeKey = (typeof allHitModeKeys)[number]
18 changes: 18 additions & 0 deletions libs/sr-data/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"rules": {}
}
]
}
3 changes: 3 additions & 0 deletions libs/sr-data/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# sr-data

This library was generated with [Nx](https://nx.dev).
16 changes: 16 additions & 0 deletions libs/sr-data/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "sr-data",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/sr-data/src",
"projectType": "library",
"targets": {
"lint": {
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["libs/sr-data/**/*.ts"]
}
}
},
"tags": []
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import type { ICharacter } from './ICharacter'
import type { ILightCone } from './ILightCone'
import type { IRelic } from './IRelic'

export type ISRODatabase = {
format: 'SRO'
export type ISrDatabase = {
format: string
source: string
version: 1
characters?: ICharacter[]
Expand Down
4 changes: 4 additions & 0 deletions libs/sr-data/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export * from './ICharacter'
export * from './ILightCone'
export * from './IRelic'
export * from './ISRDatabase'
19 changes: 19 additions & 0 deletions libs/sr-data/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"module": "commonjs",
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true
},
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.lib.json"
}
]
}
10 changes: 10 additions & 0 deletions libs/sr-data/tsconfig.lib.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"declaration": true,
"types": ["node"]
},
"include": ["src/**/*.ts"],
"exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"]
}
4 changes: 0 additions & 4 deletions libs/sr-db/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# sr-db

This library was generated with [Nx](https://nx.dev).

## Running unit tests

Run `nx test sr-db` to execute the unit tests via [Jest](https://jestjs.io).
8 changes: 0 additions & 8 deletions libs/sr-db/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@
"options": {
"lintFilePatterns": ["libs/sr-db/**/*.ts"]
}
},
"test": {
"executor": "@nx/vite:test",
"outputs": ["{options.reportsDirectory}"],
"options": {
"passWithNoTests": true,
"reportsDirectory": "../../coverage/libs/sr-db"
}
}
},
"tags": []
Expand Down
30 changes: 30 additions & 0 deletions libs/sr-db/src/ISroCharacter.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import type {
RelicSlotKey,
CharacterKey,
HitModeKey,
} from '@genshin-optimizer/sr-consts'
import type { ICharacter } from '@genshin-optimizer/sr-data'

export interface ISroCharacter extends ICharacter {
hitMode: HitModeKey
// conditional: IConditionalValues
// bonusStats: Partial<Record<InputPremodKey, number>>
// enemyOverride: Partial<
// Record<
// EleEnemyResKey | 'enemyLevel' | 'enemyDefRed_' | 'enemyDefIgn_',
// number
// >
// >
compareData: boolean
// customMultiTarget: CustomMultiTarget[]
team: [
teammate1: CharacterKey | '',
teammate2: CharacterKey | '',
teammate3: CharacterKey | ''
]
}

export interface ICachedSroCharacter extends ISroCharacter {
equippedRelics: Record<RelicSlotKey, string>
equippedWeapon: string
}
12 changes: 12 additions & 0 deletions libs/sr-db/src/ISroDatabase.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { type ISrDatabase } from '@genshin-optimizer/sr-data'

export const SroSource = 'Star Rail Optimizer' as const

export interface ISroDatabase extends ISrDatabase {
format: 'Sro'
version: 1
dbVersion: number
source: typeof SroSource
// buildSettings?: Array<BuildSetting & { id: string }>
[sroSettingsKey: string]: unknown
}
3 changes: 2 additions & 1 deletion libs/sr-db/src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './lib/sr-db'
export * from './ISroCharacter'
export * from './ISroDatabase'
3 changes: 0 additions & 3 deletions libs/sr-db/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
"references": [
{
"path": "./tsconfig.lib.json"
},
{
"path": "./tsconfig.spec.json"
}
]
}
25 changes: 0 additions & 25 deletions libs/sr-db/tsconfig.spec.json

This file was deleted.

24 changes: 0 additions & 24 deletions libs/sr-db/vite.config.ts

This file was deleted.

1 change: 1 addition & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
],
"@genshin-optimizer/sr-assets": ["libs/sr-assets/src/index.ts"],
"@genshin-optimizer/sr-consts": ["libs/sr-consts/src/index.ts"],
"@genshin-optimizer/sr-data": ["libs/sr-data/src/index.ts"],
"@genshin-optimizer/sr-db": ["libs/sr-db/src/index.ts"],
"@genshin-optimizer/sr-dm": ["libs/sr-dm/src/index.ts"],
"@genshin-optimizer/sr-formula": ["libs/sr-formula/src/index.ts"],
Expand Down

0 comments on commit 018b123

Please sign in to comment.