diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8c3c11096..c388fed0b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -66,3 +66,17 @@ jobs: uses: coverallsapp/github-action@master with: github-token: ${{ secrets.GITHUB_TOKEN }} + docs: + name: Docs + runs-on: ubuntu-latest + needs: lint + steps: + - name: Checkout code + uses: actions/checkout@v6 + - name: Use Node.js + uses: actions/setup-node@v6 + with: + node-version-file: '.nvmrc' + - run: npm ci + - name: Build + run: npm run build:docs diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index d444b3d23..5e6db1123 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -11,7 +11,11 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v6 - - run: npm i + - name: Use Node.js + uses: actions/setup-node@v6 + with: + node-version-file: '.nvmrc' + - run: npm ci - name: Build run: npm run build:docs - name: Deploy diff --git a/.gitignore b/.gitignore index 22869d9b8..9b3fdf059 100644 --- a/.gitignore +++ b/.gitignore @@ -48,4 +48,5 @@ data.*.json .eslintcache -dist/ \ No newline at end of file +dist/ +docs/ diff --git a/lib/models/Archimedea.ts b/lib/models/Archimedea.ts index 8940dbbc0..ac3f03ca6 100644 --- a/lib/models/Archimedea.ts +++ b/lib/models/Archimedea.ts @@ -23,22 +23,22 @@ export interface RawArchimedea extends BaseContentObject { Variables: string[]; } -type Difficulty = { type: string; deviation: string; risks: string[] }; +export type Difficulty = { type: string; deviation: string; risks: string[] }; -interface RawArchimedeaMission { +export interface RawArchimedeaMission { faction: string; missionType: string; difficulties: Difficulty[]; } -interface ArchidemeaMissionDifficultyRisk { +export interface ArchimedeaMissionDifficultyRisk { key: string; name: string; description: string; isHard: boolean; } -interface ArchidemeaMissionDifficulty { +export interface ArchimedeaMissionDifficulty { key: string; name: string; description: string; @@ -56,15 +56,13 @@ export class ArchimedeaMission { missionTypeKey: string; - diviation: ArchidemeaMissionDifficulty; + deviation: ArchimedeaMissionDifficulty; - risks: ArchidemeaMissionDifficultyRisk[]; + risks: ArchimedeaMissionDifficultyRisk[]; /** * @param mission Challenge mission type - * @param deviation Mission deviation - * @param risks Mission risks - * @param locale Locale to tranlslate to + * @param locale Locale for translation */ constructor(mission: RawArchimedeaMission, locale: Locale) { this.faction = faction(mission.faction, locale); @@ -74,7 +72,7 @@ export class ArchimedeaMission { this.missionTypeKey = missionType(mission.missionType, 'en'); const normal = mission.difficulties[0]; - this.diviation = { + this.deviation = { key: normal.deviation, name: languageString(normal.deviation, locale), description: languageDesc(normal.deviation, locale), diff --git a/lib/models/Kuva.ts b/lib/models/Kuva.ts index 11622f9eb..005295d8c 100644 --- a/lib/models/Kuva.ts +++ b/lib/models/Kuva.ts @@ -41,14 +41,14 @@ const hash = (str: string) => * @returns Split parsed data */ const parse = (data: KuvaLogEntry[], locale: Locale) => { - const parsed = { - kuva: [] as ExternalMission[], + const parsed: { kuva: ExternalMission[]; arbitration: ExternalMission } = { + kuva: [], arbitration: {} as ExternalMission, }; const now = new Date(); if (!data) return undefined; data?.forEach?.((mission) => { - const p = { + const p: ExternalMission = { id: '', activation: new Date(mission.start), expiry: new Date(mission.end), @@ -58,6 +58,8 @@ const parse = (data: KuvaLogEntry[], locale: Locale) => { type: nodeMissionType(mission.solnode, locale), typeKey: nodeMissionType(mission.solnode, 'en'), expired: false, + archwing: mission.solnodedata?.archwing ?? false, + sharkwing: mission.solnodedata?.sharkwing ?? false, }; truncateTime(p); p.id = hash(JSON.stringify(p)); @@ -73,9 +75,11 @@ const parse = (data: KuvaLogEntry[], locale: Locale) => { // if the diff is less than 2 hours? parsed.arbitration = p; } - if (mission.missiontype.startsWith('KuvaMission')) parsed.kuva.push(p); + if (mission.missiontype?.startsWith('KuvaMission')) { + parsed.kuva.push(p); + } } - scrub(p); + scrub(p as unknown as Record); }); parsed.kuva = Array.from(new Set(parsed.kuva)); diff --git a/lib/supporting/ExternalMission.ts b/lib/supporting/ExternalMission.ts index e261d1a24..be356a9b0 100644 --- a/lib/supporting/ExternalMission.ts +++ b/lib/supporting/ExternalMission.ts @@ -27,7 +27,7 @@ export interface ExternalMission { /** * Enemy on tile */ - enemy: string; + enemy?: string; /** * Mission type of node