Skip to content

Conversation

@TobiTenno
Copy link
Member

@TobiTenno TobiTenno commented Dec 29, 2025

What did you fix?

export more types, import aliases


Reproduction steps


Evidence/screenshot/link to line

Considerations

  • Does this contain a new dependency? [No]
  • Does this introduce opinionated data formatting or manual data entry? [Yes]
  • Does this pr include updated data files in a separate commit that can be reverted for a clean code-only pr? [Yes]
  • Have I run the linter? [Yes]
  • Is is a bug fix, feature request, or enhancement? [Enhancement]

Summary by CodeRabbit

  • Chores
    • Updated formatter/lint settings (semicolons, trailing commas) and added a pretest script; added path aliases and central re-exports; tests/examples switched to new import paths.
  • Refactor
    • Standardized module exports to named exports and consolidated a central public API, renaming core base types and exposing additional classes/types and properties for easier consumption.
  • Style
    • Widespread formatting and whitespace normalization across configs, data fixtures and tests.

✏️ Tip: You can customize this high-level summary in your review settings.

@TobiTenno TobiTenno requested a review from a team as a code owner December 29, 2025 18:31
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 29, 2025

📝 Walkthrough

Walkthrough

Convert many model/supporting modules from default to named exports, rename WorldstateObject → WorldStateObject, add barrels and TS path aliases, adjust imports/usages across WorldState, tests, and tooling config; update formatter rules and lint/test scripts.

Changes

Cohort / File(s) Change Summary
Config & entry points
biome.json, package.json, tsconfig.json, main.ts
Formatter rules changed (trailingCommas, semicolons, organizeImports object); lint scripts updated to biome check; added pretest script; TS path aliases added; main.ts re-exports ./lib/supporting and ./lib/models.
Models barrel & re-exports
lib/models/index.ts, lib/models/*
New barrel lib/models/index.ts; most model files converted from default → named exports; base class casing changed to WorldStateObject; many files expose additional public fields/getters; import paths updated to aliases.
Supporting barrel & utilities
lib/supporting/index.ts, lib/supporting/*
New barrel lib/supporting/index.ts; several supporting modules changed default → named exports (e.g., fetchProxy), types/export shapes adjusted; utilities formatting normalized.
Core types & WorldState
lib/models/WorldStateObject.ts, lib/WorldState.ts
WorldstateObject renamed/exported as WorldStateObject; WorldState now imports from @/models and uses explicit Raw* generics in parsers; steelPath type changed to SteelPathOfferings.
Model public-surface edits
lib/models/*.ts (e.g., Fissure.ts, Mission.ts, News.ts, VoidTrader.ts, SteelPathOffering.ts, WorldEvent.ts, ...)
Many classes switched to named exports and WorldStateObject base; several models add public properties/getters or expand constructor-initialized fields; JSDoc updated to new base name; import aliasing applied.
Tests & fixtures
test/unit/*.spec.ts, test/integration/*, test/testclient.ts, test/data/*
Tests switched to path aliases (@/...), import named exports from barrels, migrated assertions from should → expect style, updated fixtures (date formats: MongoDB extended JSON) and minor test formatting.
Misc typing/formatting tweaks
assorted lib/* and lib/supporting/*
Minor signature/type adjustments (optional fields, renamed interfaces), regex/location parsing tweak in SyndicateJob, formatting-only reflows and semicolon/spacing changes across files.

Sequence Diagram(s)

(Skipped — changes are refactor/type/export-oriented and do not introduce new multi-component sequential flows.)

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • AyAyEm
  • SlayerOrnstein
  • Soundofdarkness

Poem

🐇
I hopped through files and changed each name,
defaults to named — a tidy game.
WorldState dressed up in proper case,
aliases led exports to their place.
A nibble, a sprint — the library's tame.

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'fix: export common shared for external usage' is partially related to the changeset but lacks clarity and specificity about the main changes. Revise the title to be more specific about the primary changes, such as 'refactor: convert default exports to named exports and add path aliases' to better reflect the substantial scope of changes across the codebase.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🧹 Nitpick comments (12)
lib/models/Mission.ts (1)

9-10: Consider using path alias for consistency.

The import for Dependency uses a relative path ('./../supporting/Dependency') while the broader PR introduces path aliases like @/supporting. For consistency with the project-wide refactor, consider using the alias.

🔎 Suggested change
-import type { Dependency } from './../supporting/Dependency';
+import type { Dependency } from '@/supporting';
lib/models/Kuva.ts (1)

6-6: Consider simplifying the import path.

The path ./../supporting/Dependency can be simplified to ../supporting/Dependency. Both are equivalent, but the latter is more conventional.

🔎 Suggested change
-import type { Dependency } from './../supporting/Dependency';
+import type { Dependency } from '../supporting/Dependency';
lib/models/Tmp.ts (1)

1-1: Consider simplifying the import path.

Same as in Kuva.ts, the path ./../supporting/Dependency can be simplified to ../supporting/Dependency.

🔎 Suggested change
-import type { Dependency } from './../supporting/Dependency';
+import type { Dependency } from '../supporting/Dependency';
lib/models/Reward.ts (2)

3-3: Unconventional relative path.

The path ./../supporting/Dependency works but is unconventional. Consider using ../supporting/Dependency for consistency with standard relative import conventions.

🔎 Suggested fix
-import type { Dependency } from './../supporting/Dependency';
+import type { Dependency } from '../supporting/Dependency';

82-88: Consider caching getTypesFull() result.

getTypesFull() is called twice for thumbnail and twice for color. While not a blocking issue, caching the result would avoid redundant computation.

🔎 Suggested optimization
+    const typesFull = this.getTypesFull();
-    this.thumbnail = this.getTypesFull()[0]
-      ? this.getTypesFull()[0].thumbnail
+    this.thumbnail = typesFull[0]
+      ? typesFull[0].thumbnail
       : 'https://i.imgur.com/JCKyUXJ.png';

-    this.color = this.getTypesFull()[0]
-      ? this.getTypesFull()[0].color
+    this.color = typesFull[0]
+      ? typesFull[0].color
       : 0xf1c40f;
lib/models/ChallengeInstance.ts (1)

3-3: Unconventional relative path.

Same as in Reward.ts, consider using ../supporting/Dependency instead of ./../supporting/Dependency.

🔎 Suggested fix
-import type { Dependency } from './../supporting/Dependency';
+import type { Dependency } from '../supporting/Dependency';
lib/models/SortieVariant.ts (1)

9-9: Consider simplifying the import path.

The path ./../supporting/Dependency is valid but unconventional. Consider using ../supporting/Dependency for consistency with standard relative path conventions, or use the @/supporting alias if available.

🔎 Suggested fix
-import type { Dependency } from './../supporting/Dependency';
+import type { Dependency } from '../supporting/Dependency';
lib/supporting/DuviriChoice.ts (1)

17-23: Consider adding a default case for defensive coding.

The switch statement handles 'EXC_NORMAL' and 'EXC_HARD', but if data.Category has an unexpected value at runtime (despite the type definition), this.category would remain undefined. While TypeScript's type narrowing should prevent this at compile time, a default case would provide runtime safety.

🔎 Suggested fix
     switch (data.Category) {
       case 'EXC_NORMAL':
         this.category = 'normal';
         break;
       case 'EXC_HARD':
         this.category = 'hard';
+        break;
+      default:
+        this.category = 'unknown';
     }
lib/models/WeeklyChallenge.ts (1)

11-15: Pre-existing JSDoc inaccuracy.

The class description says "Represents a void trader" but this is the WeeklyChallenge class. This appears to be a copy-paste artifact from before this PR. Consider fixing while you're updating the file.

🔎 Suggested JSDoc fix
 /**
- * Represents a void trader
+ * Represents a weekly challenge
  * @augments {WorldStateObject}
  */
 export class WeeklyChallenge extends WorldStateObject {
lib/models/PersistentEnemy.ts (1)

90-93: Inconsistent parameter type compared to other models.

This constructor uses { locale: Locale } as the type annotation, while other models in this PR (e.g., DailyDeal, SyndicateMission, GlobalUpgrade) use the Dependency type. For consistency across the codebase and to allow passing additional dependency fields if needed in the future, consider aligning with the Dependency type pattern:

  constructor(
    data: RawPersistentEnemy,
-   { locale }: { locale: Locale } = { locale: 'en' }
+   { locale = 'en' }: Dependency = { locale: 'en' }
  ) {

Alternatively, if the narrower type is intentional, this is functionally correct.

lib/models/Nightwave.ts (1)

63-66: Same type inconsistency as PersistentEnemy.

Uses { locale: Locale } instead of Dependency. Same observation as noted for PersistentEnemy.ts - consider aligning with the Dependency type for consistency if desired.

lib/models/Fissure.ts (1)

116-118: Redundant date parsing.

The base class WorldStateObject already parses Activation and Expiry in its constructor (see WorldStateObject.ts lines 47-55). These re-assignments are redundant since super(data) is called first.

If intentional for explicitness, this is harmless. Otherwise, these lines can be removed:

-    this.activation = parseDate(data.Activation);
-
-    this.expiry = parseDate(data.Expiry);
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7645fb9 and ff3cf61.

📒 Files selected for processing (90)
  • biome.json
  • lib/WorldState.ts
  • lib/models/Alert.ts
  • lib/models/Archimedea.ts
  • lib/models/Calendar.ts
  • lib/models/CambionCycle.ts
  • lib/models/CetusCycle.ts
  • lib/models/ChallengeInstance.ts
  • lib/models/ConclaveChallenge.ts
  • lib/models/ConstructionProgress.ts
  • lib/models/DailyDeal.ts
  • lib/models/DarkSector.ts
  • lib/models/DarkSectorBattle.ts
  • lib/models/DuviriCycle.ts
  • lib/models/EarthCycle.ts
  • lib/models/Fissure.ts
  • lib/models/FlashSale.ts
  • lib/models/GlobalUpgrade.ts
  • lib/models/Invasion.ts
  • lib/models/Kinepage.ts
  • lib/models/Kuva.ts
  • lib/models/MidrathCycle.ts
  • lib/models/Mission.ts
  • lib/models/News.ts
  • lib/models/Nightwave.ts
  • lib/models/NightwaveChallenge.ts
  • lib/models/PersistentEnemy.ts
  • lib/models/Reward.ts
  • lib/models/SentientOutpost.ts
  • lib/models/Simaris.ts
  • lib/models/Sortie.ts
  • lib/models/SortieVariant.ts
  • lib/models/SteelPathOffering.ts
  • lib/models/SyndicateJob.ts
  • lib/models/SyndicateMission.ts
  • lib/models/Tmp.ts
  • lib/models/VallisCycle.ts
  • lib/models/VoidTrader.ts
  • lib/models/VoidTraderItem.ts
  • lib/models/VoidTraderSchedule.ts
  • lib/models/WeeklyChallenge.ts
  • lib/models/WorldEvent.ts
  • lib/models/WorldStateObject.ts
  • lib/models/ZarimanCycle.ts
  • lib/models/index.ts
  • lib/supporting/Dependency.ts
  • lib/supporting/DuviriChoice.ts
  • lib/supporting/ExternalMission.ts
  • lib/supporting/FetchProxy.ts
  • lib/supporting/ImgCdn.ts
  • lib/supporting/KuvaLogEntry.ts
  • lib/supporting/RewardTypes.ts
  • lib/supporting/index.ts
  • main.ts
  • package.json
  • test/integration/integration.spec.ts
  • test/testclient.ts
  • test/unit/alert.spec.ts
  • test/unit/archimedea.spec.ts
  • test/unit/calendar.spec.ts
  • test/unit/cambion.spec.ts
  • test/unit/cetus.spec.ts
  • test/unit/conclavechallenge.spec.ts
  • test/unit/construction.spec.ts
  • test/unit/dailydeal.spec.ts
  • test/unit/darksector.spec.ts
  • test/unit/earth_cycle.spec.ts
  • test/unit/event.spec.ts
  • test/unit/fissure.spec.ts
  • test/unit/flashsale.spec.ts
  • test/unit/globalupgrade.spec.ts
  • test/unit/invasion.spec.ts
  • test/unit/kinepage.spec.ts
  • test/unit/kuva.spec.ts
  • test/unit/mission.spec.ts
  • test/unit/news.spec.ts
  • test/unit/nightwave.spec.ts
  • test/unit/persistentenemy.spec.ts
  • test/unit/reward.spec.ts
  • test/unit/sentientOutpost.spec.ts
  • test/unit/simaris.spec.ts
  • test/unit/sortie.spec.ts
  • test/unit/sortievariant.spec.ts
  • test/unit/syndicatejob.spec.ts
  • test/unit/syndicatemission.spec.ts
  • test/unit/system.spec.ts
  • test/unit/voidtrader.spec.ts
  • test/unit/worldstate.spec.ts
  • test/unit/zariman.spec.ts
  • tsconfig.json
🧰 Additional context used
🧠 Learnings (5)
📚 Learning: 2025-10-16T02:24:30.860Z
Learnt from: SlayerOrnstein
Repo: WFCD/warframe-worldstate-parser PR: 702
File: lib/models/Archidemea.ts:74-90
Timestamp: 2025-10-16T02:24:30.860Z
Learning: In Warframe's Archimedea/Conquest data structure (lib/models/Archidemea.ts), Digital Extremes duplicates difficulties when adding hard tier risks. The first risk in higher difficulties (e.g., CD_HARD) is always identical to the one in the normal difficulty (CD_NORMAL), so using `slice(1)` to skip the first risk when processing additional difficulties is the correct approach to avoid duplicates.

Applied to files:

  • lib/models/DarkSectorBattle.ts
  • lib/models/ChallengeInstance.ts
  • lib/models/Reward.ts
  • lib/models/SortieVariant.ts
  • test/unit/archimedea.spec.ts
  • lib/WorldState.ts
  • lib/models/Archimedea.ts
  • lib/models/Mission.ts
  • lib/models/DarkSector.ts
📚 Learning: 2025-10-06T01:01:03.277Z
Learnt from: SlayerOrnstein
Repo: WFCD/warframe-worldstate-parser PR: 692
File: lib/Tmp.ts:49-51
Timestamp: 2025-10-06T01:01:03.277Z
Learning: In lib/Tmp.ts, the fields `QTCCFloofCount` and `QTCCFloofLimit` from the Warframe worldstate API always exist together - if one is present, the other is guaranteed to be present as well.

Applied to files:

  • lib/models/Tmp.ts
📚 Learning: 2024-12-19T17:07:27.023Z
Learnt from: SlayerOrnstein
Repo: WFCD/warframe-worldstate-parser PR: 593
File: lib/models/Calendar.js:31-45
Timestamp: 2024-12-19T17:07:27.023Z
Learning: In `Calendar.js`, the constructor can safely assume `calendar.Days` is always present and an array, per user statement.

Applied to files:

  • test/unit/calendar.spec.ts
📚 Learning: 2025-08-21T23:39:46.622Z
Learnt from: SlayerOrnstein
Repo: WFCD/warframe-worldstate-parser PR: 654
File: biome.json:43-50
Timestamp: 2025-08-21T23:39:46.622Z
Learning: Biome's import organization feature is configured using the "assist" → "actions" → "source" → "organizeImports" structure in biome.json, NOT as a top-level "organizeImports" section. The correct minimal configuration is:

```json
"assist": {
  "enabled": true,
  "actions": {
    "source": {
      "organizeImports": "on"
    }
  }
}
```

This is according to Biome's official documentation at https://biomejs.dev/assist/actions/organize-imports/

Applied to files:

  • biome.json
📚 Learning: 2025-08-21T23:39:46.622Z
Learnt from: SlayerOrnstein
Repo: WFCD/warframe-worldstate-parser PR: 654
File: biome.json:43-50
Timestamp: 2025-08-21T23:39:46.622Z
Learning: In Biome configuration (biome.json), import organization should be configured using the "assist" block with nested "actions" → "source" → "organizeImports" structure, not as a top-level "organizeImports" section. The correct format is:
```json
"assist": {
  "enabled": true,
  "actions": {
    "source": {
      "organizeImports": "on"
    }
  }
}
```

Applied to files:

  • biome.json
🧬 Code graph analysis (39)
lib/supporting/RewardTypes.ts (1)
lib/supporting/RewardData.ts (1)
  • auras (23-48)
test/unit/construction.spec.ts (1)
lib/models/ConstructionProgress.ts (1)
  • ConstructionProgress (9-30)
test/unit/kuva.spec.ts (1)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/models/SentientOutpost.ts (1)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/models/ChallengeInstance.ts (1)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/models/DuviriCycle.ts (1)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/models/Reward.ts (2)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/supporting/RewardTypes.ts (1)
  • RewardType (8-33)
lib/models/WeeklyChallenge.ts (2)
lib/models/WorldStateObject.ts (2)
  • BaseContentObject (14-18)
  • WorldStateObject (23-79)
lib/models/ChallengeInstance.ts (2)
  • RawChallengeInstance (5-13)
  • ChallengeInstance (18-69)
lib/models/MidrathCycle.ts (1)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/models/News.ts (2)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/supporting/ImgCdn.ts (2)
  • deProxy (7-14)
  • cdn (1-2)
lib/models/Calendar.ts (1)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
test/unit/sentientOutpost.spec.ts (2)
lib/models/SentientOutpost.ts (1)
  • SentientOutpost (40-94)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
test/unit/reward.spec.ts (1)
lib/models/Reward.ts (1)
  • getItemType (9-12)
lib/models/Invasion.ts (2)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/models/Reward.ts (1)
  • Reward (31-108)
lib/models/ZarimanCycle.ts (1)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/models/SyndicateJob.ts (2)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/models/DailyDeal.ts (2)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/models/GlobalUpgrade.ts (2)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/models/Sortie.ts (3)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/models/SortieVariant.ts (1)
  • SortieVariant (21-76)
test/unit/syndicatejob.spec.ts (1)
lib/models/SyndicateJob.ts (2)
  • SyndicateJob (115-260)
  • RawSyndicateJob (95-105)
lib/models/Alert.ts (4)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/models/Mission.ts (1)
  • Mission (40-230)
lib/models/SentientOutpost.ts (1)
  • Mission (30-34)
lib/models/CetusCycle.ts (1)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/models/EarthCycle.ts (1)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/models/VallisCycle.ts (1)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
test/unit/archimedea.spec.ts (1)
lib/models/Archimedea.ts (2)
  • Archimedea (103-154)
  • RawArchimedea (20-24)
lib/WorldState.ts (5)
lib/models/WorldStateObject.ts (2)
  • BaseContentObject (14-18)
  • WorldStateObject (23-79)
lib/models/SteelPathOffering.ts (1)
  • SteelPathOfferings (86-119)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/models/WorldEvent.ts (2)
  • WorldEvent (91-388)
  • RawWorldEvent (46-85)
lib/models/WeeklyChallenge.ts (1)
  • WeeklyChallenge (15-27)
lib/models/ConstructionProgress.ts (1)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/models/Nightwave.ts (1)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/models/SyndicateMission.ts (3)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/models/SyndicateJob.ts (1)
  • SyndicateJob (115-260)
lib/models/VoidTrader.ts (4)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/models/VoidTraderItem.ts (1)
  • VoidTraderItem (14-46)
lib/models/VoidTraderSchedule.ts (1)
  • VoidTraderSchedule (9-20)
lib/models/PersistentEnemy.ts (1)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/models/Archimedea.ts (1)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/models/Mission.ts (2)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/models/Reward.ts (1)
  • Reward (31-108)
lib/models/NightwaveChallenge.ts (1)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/models/FlashSale.ts (2)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/models/CambionCycle.ts (1)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/models/DarkSector.ts (4)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/models/Mission.ts (1)
  • Mission (40-230)
lib/models/DarkSectorBattle.ts (1)
  • DarkSectorBattle (22-79)
lib/models/Fissure.ts (2)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/models/WorldEvent.ts (2)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
🪛 GitHub Check: CodeQL
lib/models/SyndicateJob.ts

[failure] 229-229: Polynomial regular expression used on uncontrolled data
This regular expression that depends on library input may run slow on strings with many repetitions of 'A'.
This regular expression that depends on library input may run slow on strings with many repetitions of 'A'.
This regular expression that depends on library input may run slow on strings with many repetitions of 'A'.
This regular expression that depends on library input may run slow on strings with many repetitions of 'A'.
This regular expression that depends on library input may run slow on strings with many repetitions of 'A'.
This regular expression that depends on library input may run slow on strings with many repetitions of 'A'.
This regular expression that depends on library input may run slow on strings with many repetitions of 'A'.

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Test (20)
  • GitHub Check: Coverage
🔇 Additional comments (131)
test/unit/zariman.spec.ts (1)

3-3: LGTM!

The import correctly uses the new path alias @/models with a named import, aligning with the project-wide migration from default exports to named exports and centralized barrel files.

lib/supporting/FetchProxy.ts (1)

10-22: LGTM!

The reformatted function signature improves readability. The default values are correctly duplicated in both the destructuring assignment and the default object, ensuring proper defaults when the options object is partially provided or omitted entirely.

lib/supporting/ExternalMission.ts (1)

4-4: LGTM!

The switch from default export to named export aligns with the project-wide refactor and enables cleaner imports via the barrel file pattern.

lib/supporting/RewardTypes.ts (1)

39-39: LGTM!

The parentheses around the type assertion improve clarity and are consistent with biome formatting rules.

lib/supporting/ImgCdn.ts (1)

1-14: LGTM!

Formatting changes only - the multi-line formatting improves readability without altering behavior.

lib/models/SteelPathOffering.ts (1)

86-93: LGTM!

Good changes:

  1. Switch to named export aligns with the project-wide refactor
  2. Explicit public property declarations (remaining, rotation, evergreens, incursions) improve API discoverability and type documentation
lib/models/Mission.ts (1)

40-40: LGTM!

The switch to named export aligns with the project-wide refactor and enables cleaner imports via the barrel file pattern.

package.json (1)

41-42: Good improvement: Using biome check for comprehensive verification.

Switching from biome lint to biome check runs the full toolchain (formatting, linting, import-sorting) in a single command, which is the recommended approach for CI and local validation.

lib/models/VoidTraderItem.ts (1)

3-3: LGTM! Consistent conversion to named exports.

The changes correctly convert both the Dependency import and the VoidTraderItem class export from default to named style, aligning with the PR's objective to standardize on named exports across the codebase.

Also applies to: 14-14

test/unit/darksector.spec.ts (1)

3-3: LGTM! Proper use of path alias and named imports.

The import correctly uses the @/models barrel export to access both DarkSector and its type definition.

test/testclient.ts (1)

1-2: LGTM! Improved test client clarity.

The explicit process.exit() calls on success (line 14) and error (line 17) make the test client's behavior more explicit and predictable. The updated import paths to .mjs extensions correctly target the compiled output.

Also applies to: 14-17

test/unit/earth_cycle.spec.ts (1)

3-3: LGTM! Consistent path alias adoption.

The import correctly uses the @/models barrel export with named import syntax, aligning with the PR's refactoring objectives.

test/unit/flashsale.spec.ts (1)

3-3: LGTM! Proper path alias usage.

The import correctly uses the @/models barrel export to access both the class and type definition.

lib/models/DarkSectorBattle.ts (1)

6-6: Capitalization change has been consistently applied throughout the codebase.

Verification confirms no remaining references to the old "WorldstateObject" spelling exist, and all imports and usages correctly reference "WorldStateObject" across the entire codebase. The change is complete and consistent.

test/unit/sortievariant.spec.ts (1)

3-6: The .js extension usage pattern is consistent across the codebase and intentional for ESM compatibility.

All direct file imports from alias paths (e.g., @/models/SortieVariant.js, @/supporting/Dependency.js) use explicit .js extensions, while barrel/directory imports (e.g., @/models, @/supporting) omit the extension. This distinction is correctly applied throughout the codebase.

main.ts (1)

5-6: Wildcard re-exports are appropriately scoped.

The expanded public API from ./lib/supporting and ./lib/models is properly structured. The exports consist entirely of intentional public-facing classes and interfaces (e.g., Tmp, Alert, Mission, ImgCdn), and no internal or private APIs are unintentionally exposed. No naming conflicts arise from these wildcard exports, as all exported names are distinct across modules.

test/unit/news.spec.ts (2)

3-6: LGTM! Clean migration to path aliases.

The import updates correctly leverage the new path alias system for both models and test data, improving maintainability and reducing brittleness from relative paths.


94-95: Formatting change looks fine.

The ImageUrl value split across lines is cosmetic and doesn't affect functionality.

test/unit/mission.spec.ts (1)

3-4: LGTM! Consistent with the alias migration.

Import paths correctly updated to use the centralized alias system.

test/unit/globalupgrade.spec.ts (1)

3-3: LGTM! Import path updated correctly.

test/unit/simaris.spec.ts (1)

3-3: LGTM! Import migration completed correctly.

test/unit/sortie.spec.ts (1)

3-3: LGTM! Alias import applied correctly.

lib/supporting/Dependency.ts (1)

9-9: Export style change from default to named export is complete and verified.

All 16+ consumers of the Dependency interface have been updated to use named imports (import type { Dependency }). No default imports remain in the codebase, and the re-export in lib/supporting/index.ts properly exposes the named export.

test/unit/worldstate.spec.ts (1)

5-11: Import paths updated correctly.

The migration to path aliases is consistent. Note that Line 11 includes the .js extension in the alias path (@/WorldState.js), which differs from the extension-less imports used elsewhere. Verify this is intentional and supported by your module resolution strategy.

tsconfig.json (1)

14-22: Path alias configuration is properly supported by build and test tooling.

The baseUrl and paths configuration in tsconfig.json is correct. Verification confirms that path aliases are fully functional at runtime:

  • Test execution: mocha is configured with the tsx loader (via node-option: import=tsx), which natively supports TypeScript path aliases
  • Build output: tsdown, a TypeScript-based bundler, inherently supports all TypeScript features including path aliases—the dist directory and compiled output confirm successful builds
  • Active usage: All three aliases (@/models, @/supporting, @/data) are actively used in source files (lib/) and test files, indicating the configuration works as intended

No additional build tool configuration is required.

lib/supporting/index.ts (1)

1-8: LGTM! Clean barrel export pattern.

The barrel file correctly consolidates all supporting module exports, enabling cleaner imports throughout the codebase.

test/unit/kinepage.spec.ts (1)

4-4: LGTM! Alias-based import.

The switch to path aliases improves maintainability and aligns with the project's new import strategy.

test/unit/calendar.spec.ts (2)

4-5: LGTM! Consistent alias usage.

The import paths now use the project's path aliases, improving code organization and making imports more maintainable.


16-22: Multi-line formatting applied.

The test assertions have been reformatted to multi-line style, which improves readability for longer assertion chains.

lib/models/VoidTraderSchedule.ts (2)

1-8: LGTM! Clean import and export refactoring.

The conversion to named exports and type-only imports aligns with the project's new export strategy while preserving all functionality.


9-20: Named export applied consistently.

The class is now exported as a named export, maintaining the same public interface and behavior.

test/unit/dailydeal.spec.ts (1)

3-3: LGTM! Consistent barrel import usage.

The import correctly uses the barrel export from @/models, providing a clean and maintainable import path.

lib/models/Simaris.ts (2)

3-3: LGTM! Type-only import for Dependency.

The import correctly uses a named type import since Dependency is only used in type positions.


13-48: Named export applied consistently.

The class export has been converted to a named export, maintaining the same public interface (target, isTargetActive, asString) and behavior.

test/unit/cetus.spec.ts (1)

3-3: LGTM! Alias-based import.

The import correctly uses the path alias and barrel export, providing a clean and maintainable import path.

test/unit/syndicatejob.spec.ts (1)

3-14: The direct module import pattern is consistent with other related tests.

The syndicatejob.spec.ts file imports directly from @/models/SyndicateJob.js rather than the barrel export. While this differs from the majority of test files (~83%), this same pattern is shared by VoidTrader.js, SyndicateMission.js, and SortieVariant.js imports in their respective test files, suggesting this may be intentional for related modules.

test/unit/nightwave.spec.ts (1)

3-5: LGTM! Import paths correctly updated to use path aliases.

The migration to @/models, @/supporting, and @/data aliases is consistent with the PR's objective to establish centralized path aliases across the codebase.

lib/models/WorldStateObject.ts (1)

23-23: Good rename to WorldStateObject for consistent PascalCase.

The capitalization fix from WorldstateObject to WorldStateObject improves naming consistency across the codebase. The switch to a named export aligns with the PR's broader refactoring objective.

test/unit/reward.spec.ts (1)

5-5: LGTM! Import correctly updated to use named exports from the barrel module.

The import of getItemType, RawReward, and Reward as named exports from @/models aligns with the public API changes in lib/models/Reward.ts.

lib/models/Kinepage.ts (2)

1-1: LGTM! Named export aligns with the codebase-wide refactoring.


20-27: Improved readability with multi-line formatting.

The translation extraction logic is now more readable with clearer line breaks for the Object.fromEntries calls.

test/unit/event.spec.ts (1)

3-4: LGTM! Imports correctly updated to use path aliases and renamed class.

lib/models/Kuva.ts (1)

92-92: LGTM! Named export aligns with the codebase-wide refactoring.

lib/models/Tmp.ts (1)

1-3: LGTM! Named imports correctly updated to match export changes.

The imports for Kinepage and SentientOutpost as named exports align with their respective module changes. Based on retrieved learnings, the non-null assertion on QTCCFloofLimit (line 38) is valid since these fields always exist together in the API response.

test/unit/construction.spec.ts (2)

3-3: LGTM!

The import correctly uses the new path alias and named export pattern. The class reference is now consistent with the actual class name ConstructionProgress.


13-29: Test updates align with the refactored export.

All instantiations correctly reference ConstructionProgress instead of the previous alias. Test assertions remain unchanged and continue to validate the expected behavior.

lib/models/Reward.ts (1)

31-31: Named export aligns with PR objectives.

The switch from default to named export is consistent with the codebase-wide refactoring.

lib/models/Invasion.ts (3)

9-12: Clean import refactoring.

Imports correctly use the barrel export from ../supporting and named imports for local modules. This aligns well with the centralized export pattern.


50-50: Named export with updated base class.

The switch to named export and WorldStateObject (corrected capitalization) is consistent with the PR objectives.


126-139: Reward instantiation logic is sound.

The optional chaining and empty object check correctly handle cases where attacker/defender rewards may be absent.

lib/models/ChallengeInstance.ts (1)

18-68: Named export and formatting changes look good.

The class export and constructor formatting align with the PR's refactoring pattern. Logic remains unchanged.

test/unit/alert.spec.ts (1)

3-4: Path alias imports look good.

The imports correctly use the new @/models and @/data path aliases. The JSON import attribute syntax (with { type: 'json' }) follows modern ESM conventions for importing JSON modules.

test/unit/archimedea.spec.ts (2)

4-5: Path alias imports correctly applied.

The imports use the new @/models and @/data path aliases with proper named export syntax.


13-22: Class name corrected to Archimedea.

All references updated from Archidemea to Archimedea, fixing the typo in the class name. Test logic remains intact.

lib/models/CetusCycle.ts (3)

2-3: Import updated to named import.

The import correctly uses the named export pattern for WorldStateObject.


23-25: JSDoc and export updated correctly.

The @augments tag and class declaration both reference WorldStateObject with corrected capitalization, and the class is now a named export.


103-110: Formatting changes only.

The calculation logic is unchanged; only line breaks were adjusted for readability.

lib/models/DuviriCycle.ts (2)

2-2: Import updated to named import.

The import correctly uses the named export pattern for WorldStateObject.


32-35: JSDoc and class declaration updated.

The @typedef, @augments, and class declaration all correctly reference WorldStateObject with proper capitalization. The switch to a named export aligns with the PR objectives.

test/unit/persistentenemy.spec.ts (1)

3-3: LGTM!

The import correctly uses the named export syntax with the new @/models path alias, aligning with the PR-wide refactoring.

lib/supporting/KuvaLogEntry.ts (1)

1-19: LGTM!

Formatting changes are consistent and appear to be formatter-driven. No functional changes to the interface definitions.

test/integration/integration.spec.ts (3)

9-9: LGTM!

The import correctly uses the path alias for the FetchProxy module.


39-43: LGTM!

The expanded options object improves readability, and explicitly passing kuvaData: undefined aligns with the commented-out kuva data fetching above.


55-66: LGTM!

Multi-line formatting for the filter and assertion chains improves readability without changing behavior.

lib/models/NightwaveChallenge.ts (3)

7-7: LGTM!

The import correctly uses named import syntax for WorldStateObject and BaseContentObject, aligning with the PR-wide refactoring.


19-21: LGTM!

The JSDoc @augments annotation and class declaration correctly reference the renamed WorldStateObject base class.


57-60: LGTM!

Multi-line constructor signature improves readability without changing behavior.

lib/models/VallisCycle.ts (3)

3-3: LGTM!

The import correctly uses named import syntax for WorldStateObject.


67-69: LGTM!

The JSDoc @augments annotation and class declaration correctly reference the renamed WorldStateObject base class, and the class is now exported as a named export.


37-38: Pre-existing issue: Possible bug in cycle calculation.

Line 38 uses lStart.getMilliseconds() which returns only the milliseconds component (0-999), not the full timestamp. This seems like it should be lStart.getTime() to get the epoch timestamp for the cycle calculation. This is not part of the current PR's changes but may be worth investigating.

test/unit/sentientOutpost.spec.ts (2)

4-5: LGTM!

The imports correctly use named exports with path aliases. Using type import for Dependency is appropriate since it's only used for type casting.


13-16: LGTM!

Multi-line formatting for the constructor call improves readability without changing test behavior.

test/unit/conclavechallenge.spec.ts (1)

3-6: LGTM!

The imports correctly use named exports with path aliases. The JSON import attribute (with { type: 'json' }) is the proper ESM syntax for importing JSON modules.

lib/models/SentientOutpost.ts (3)

1-7: LGTM!

The imports are correctly organized with multi-line formatting, and using type import for Dependency is appropriate since it's only used for type annotations.


40-62: LGTM!

The class is now a named export with explicitly declared public properties (id, activation, expiry, mission, active), improving the public API surface and TypeScript type inference.


68-71: LGTM!

Multi-line constructor signature improves readability. The destructuring of Dependency is correct.

test/unit/invasion.spec.ts (1)

3-3: LGTM!

The import correctly uses the new @/models path alias with named exports, aligning with the PR's refactoring goals. The type modifier on RawInvasion is appropriate for type-only imports.

lib/models/ZarimanCycle.ts (1)

3-3: LGTM!

The import and export changes correctly follow the PR's refactoring pattern:

  • Named import of WorldStateObject (with corrected capitalization)
  • Named export of the class
  • JSDoc @augments updated to match the renamed base class

Also applies to: 23-25

test/unit/cambion.spec.ts (1)

3-3: LGTM!

The import correctly uses named exports from the @/models alias. Using type CetusCycle is appropriate since it's only used for type assertions in the tests.

lib/models/SortieVariant.ts (1)

21-21: LGTM!

The class is correctly converted to a named export, and the constructor reformatting improves readability.

Also applies to: 58-61

lib/models/ConstructionProgress.ts (2)

10-12: LGTM!

The new unknownProgress property extends the public API surface appropriately. The property declarations align with the existing pattern for fomorianProgress and razorbackProgress.


3-3: LGTM!

The import and export changes correctly follow the PR's refactoring pattern with named imports/exports and the updated WorldStateObject base class.

Also applies to: 9-9

lib/models/EarthCycle.ts (1)

3-3: LGTM!

The import and export changes correctly follow the PR's refactoring pattern:

  • Named import of WorldStateObject
  • Named export of EarthCycle
  • JSDoc @augments updated to reflect the renamed base class

Also applies to: 84-86

lib/supporting/DuviriChoice.ts (1)

1-1: LGTM!

The import correctly uses the barrel export from ../models for type imports, and the class is properly converted to a named export.

Also applies to: 11-11

test/unit/fissure.spec.ts (1)

3-3: LGTM!

The import correctly uses the @/models path alias with named exports, consistent with the PR's refactoring pattern across all test files.

test/unit/system.spec.ts (1)

3-8: LGTM – Import aliases and named exports correctly applied.

The switch to path aliases (@/supporting, @/data, @/../main.js) and the named export for Dependency aligns with the broader PR refactoring. The imports are well-organized with appropriate grouping.

lib/models/SyndicateJob.ts (2)

3-5: LGTM – Named exports and type imports properly updated.

Import changes correctly use named exports for Dependency (as type import) and WorldStateObject/Identifier, aligning with the codebase-wide refactor.


115-115: LGTM – Named export with updated base class.

The switch from default export to named export and the base class rename to WorldStateObject is consistent with the PR's public API surface changes.

lib/models/MidrathCycle.ts (2)

5-5: LGTM – Named import for WorldStateObject.

The import update aligns with the renamed and re-exported base class across the codebase.


45-45: LGTM – Named export with correct base class.

The switch to named export and WorldStateObject base class is consistent with the broader refactor.

lib/models/ConclaveChallenge.ts (2)

10-12: LGTM – Import updates properly structured.

The type import for Dependency and named imports for BaseContentObject/WorldStateObject correctly follow the new public API surface pattern.


27-27: LGTM – Named export with WorldStateObject base.

Consistent with the codebase-wide migration to named exports and the WorldStateObject capitalization.

test/unit/syndicatemission.spec.ts (1)

3-6: LGTM – Consolidated named imports from alias path.

The switch to a single import statement with both the type (RawSyndicateMission) and class (SyndicateMission) from the alias path @/models/SyndicateMission.js is clean and aligns with the PR's refactoring goals.

biome.json (2)

51-77: LGTM – Import organization correctly configured.

The assist.actions.source.organizeImports structure properly follows Biome's documented configuration format. The import groups logically organize:

  1. URL imports
  2. Node/Bun built-ins
  3. External packages
  4. Organization packages (@wfcd/)
  5. Project path aliases (@/models, @/supporting, @/data)
  6. Relative imports

Based on learnings, this matches the correct Biome configuration structure.


2-2: Schema version is valid and stable.

Biome 2.3.10 is confirmed as a valid stable release.

lib/models/CambionCycle.ts (2)

3-4: LGTM – Named imports correctly applied.

The type import for CetusCycle and value import for WorldStateObject properly follow the new named export pattern.


10-10: LGTM – Named export with WorldStateObject base.

Consistent with the codebase-wide migration to named exports and the WorldStateObject capitalization.

test/unit/kuva.spec.ts (1)

3-5: LGTM – Path aliases and named exports properly applied.

The imports correctly use:

  • Named export for Kuva from the barrel module @/models
  • Type-only import for Dependency from @/supporting
  • JSON import with proper import attribute syntax

This aligns well with the PR's refactoring goals and modern ESM practices.

lib/models/Archimedea.ts (2)

1-13: LGTM! Import reorganization and named exports.

The changes properly update imports to use the path alias @/supporting for the Dependency type and switch to named exports from WorldStateObject. The formatting is clean and consistent with the PR objectives.


103-153: LGTM! Class export and formatting changes.

The switch from default export to named export (export class Archimedea) and the minor formatting adjustments in the constructor are clean. No behavioral changes.

lib/models/Calendar.ts (2)

1-8: LGTM! Import updates.

The imports are properly reorganized with the named import for WorldStateObject and BaseContentObject from the local module path.


65-108: LGTM! Named export conversion.

The switch to named export for Calendar class is consistent with the codebase-wide refactoring. Minor formatting adjustments are clean.

lib/models/FlashSale.ts (2)

8-9: LGTM! Import updates.

The imports are correctly updated to use type-only import for Dependency and named imports for WorldStateObject and BaseContentObject.


26-76: LGTM! Named export and constructor formatting.

The conversion to named export and the constructor signature formatting are clean. No behavioral changes.

lib/models/News.ts (3)

10-12: LGTM! Import updates.

The blank line additions and named import for WorldStateObject properly align with the codebase-wide refactoring.


33-35: LGTM! JSDoc and export updates.

The @augments tag correctly references WorldStateObject with proper capitalization, and the class is now a named export.


90-145: LGTM! Constructor formatting.

The multi-line formatting changes in the constructor improve readability without changing any behavior.

lib/models/Alert.ts (2)

3-6: LGTM! Import reorganization.

Clean separation of type imports and value imports, properly using named exports from the updated module structure.


15-47: LGTM! Named export and constructor updates.

The class is correctly converted to a named export. The use of optional chaining in this.reward?.getTypes()?.length is appropriate defensive coding.

lib/models/VoidTrader.ts (2)

9-13: LGTM! Import updates.

The imports are properly organized with type-only import for Dependency and named imports for model classes and types.


26-91: LGTM! Named export and constructor formatting.

The conversion to named export is correct. The use of nullish coalescing (character ?? '') on line 79 provides a clean fallback. All formatting changes improve readability without altering behavior.

lib/models/DarkSector.ts (3)

1-10: LGTM! Import reorganization.

The imports are properly restructured with named exports from the updated module paths.


45-47: LGTM! Named export conversion.

The JSDoc and class declaration are correctly updated for the named export pattern.


158-224: LGTM! Constructor formatting changes.

The multi-line formatting changes improve readability. All conditional assignments (parseDate, new Mission, map) retain their original logic.

lib/models/WeeklyChallenge.ts (2)

1-5: LGTM! Import updates.

The imports are properly organized with named exports for both ChallengeInstance and WorldStateObject.


21-26: LGTM! Constructor formatting.

The multi-line formatting for the map callback improves readability.

lib/models/DailyDeal.ts (1)

8-9: LGTM - Consistent with PR-wide refactoring pattern.

The changes correctly migrate to named exports and update the base class reference from WorldstateObject to WorldStateObject. The import paths and constructor formatting are consistent with the other model files in this PR.

Also applies to: 25-25, 71-74

lib/models/SyndicateMission.ts (1)

1-11: LGTM - Clean migration to named exports with barrel imports.

The file correctly migrates to named exports and uses the cleaner barrel import pattern (../supporting) for the Dependency type. The @augments annotation and class declaration are properly updated to reference WorldStateObject.

Also applies to: 22-22

lib/models/Sortie.ts (1)

10-14: LGTM - Properly aligned with the refactoring pattern.

The imports, export style, and constructor parameter type (Dependency) are consistent with the PR-wide conventions. The @augments annotation correctly references WorldStateObject.

Also applies to: 27-29, 65-68

lib/models/GlobalUpgrade.ts (1)

10-11: LGTM - Consistent implementation.

The migration to named exports, updated imports, and Dependency type usage are all properly aligned with the PR's refactoring conventions.

Also applies to: 24-24, 50-53

lib/models/Fissure.ts (1)

13-15: LGTM - Core refactoring changes are correct.

The migration to named exports, updated @augments annotation, and constructor signature changes are properly implemented and consistent with the PR pattern.

Also applies to: 29-31, 87-90

lib/WorldState.ts (4)

5-61: LGTM - Clean consolidation of imports using path aliases.

The migration to the @/models and @/supporting barrel imports significantly improves import organization. All model types and their raw data types are now imported from a single source, which enhances maintainability.


119-122: Appropriate generic constraint update.

The T extends WorldStateObject constraint correctly reflects that parseAsyncArray operates on classes with WorldStateObject properties (like id, active). This aligns with the filtering logic on line 140 that accesses obj.active.


525-528: Clean spread pattern for adding character dependency.

The explicit character: 'Varzia' addition via spread is clear and maintainable.


336-336: Type correctly renamed from SteelPathOffering to SteelPathOfferings. No remaining references to the singular type exist. The property type aligns with the actual class name, and all downstream usages are consistent.

lib/models/WorldEvent.ts (5)

11-18: Imports updated to use named exports and path alias.

The import changes correctly align with the codebase-wide refactor:

  • Using named type imports for Dependency, RawReward, RawSyndicateJob, BaseContentObject, Identifier
  • Importing WorldStateObject (consistent capitalization) as the base class

232-235: LGTM!

Multi-line formatting for the method signature improves readability.


260-263: LGTM!

Constructor signature formatting is clean with appropriate default value handling for the Dependency parameter.


280-288: Formatting changes improve readability.

Multi-line ternary expressions and callback formatting are consistent and align with the biome formatter rules.


89-91: Named export and base class extension are correct.

The class properly uses a named export and extends WorldStateObject. Verification confirms all imports in the codebase are using the named import pattern—no default imports of WorldEvent were found. The barrel export in index.ts maintains compatibility with the import structure.

lib/models/index.ts (1)

1-42: Well-structured barrel export file with complete model coverage.

This provides a clean, centralized entry point for all model exports. The alphabetical ordering aids maintainability, and verification confirms all 42 model files in the directory are included with no duplicates.

One consideration: using export * can inadvertently expose internal types. If any modules export implementation details that shouldn't be part of the public API, consider using explicit named re-exports for those modules.

@TobiTenno TobiTenno changed the title fix: export more fix: export common shared for external usage Dec 29, 2025
@TobiTenno TobiTenno force-pushed the aliases-exports-oh-my branch from fdce031 to 4062218 Compare December 29, 2025 19:59
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

♻️ Duplicate comments (4)
lib/models/Mission.ts (1)

9-9: Verify the import path syntax.

Same issue as in SentientOutpost.ts: the import path ./@/supporting/Dependency combines a relative path prefix with a path alias. Verify this is the intended format.

lib/models/Sortie.ts (1)

11-11: Verify the import path syntax.

Same pattern: ./@/supporting/Dependency combines relative prefix with path alias.

lib/models/Fissure.ts (1)

14-14: Verify the import path syntax.

Same issue: ./@/supporting/Dependency combines relative prefix with path alias.

lib/models/WorldEvent.ts (1)

343-345: Note: Pre-existing issue remains unaddressed.

As flagged in a previous review, the MultiProgress reduce operation may have a string concatenation issue since MultiProgress is typed as string[]. This formatting change doesn't address that concern.

Since this PR focuses on refactoring exports and imports rather than fixing logic bugs, this issue can be addressed separately. However, it's worth keeping in mind for future work.

🧹 Nitpick comments (2)
lib/supporting/FetchProxy.ts (1)

10-22: Good: Named export aligns with the PR's goal of enabling external usage.

The change from default to named export is appropriate. However, the default values are duplicated in both the destructuring pattern (lines 13-14) and the fallback object (lines 19-20). Consider simplifying by relying only on the destructuring defaults:

🔎 Suggested simplification
 export const fetchProxy = async (
   url: string,
   {
     session = 'parser-session',
     contentType = 'application/json',
   }: {
     session?: string;
     contentType?: 'application/json' | 'text/html';
-  } = {
-    session: 'parser-session',
-    contentType: 'application/json',
-  }
+  } = {}
 ) => {
lib/supporting/DuviriChoice.ts (1)

17-23: Consider adding a default case to the switch statement.

The switch statement lacks a default case, which means this.category will be undefined if data.Category has an unexpected value at runtime. While TypeScript constrains the type, adding a default case improves defensive programming.

🔎 Suggested enhancement
   switch (data.Category) {
     case 'EXC_NORMAL':
       this.category = 'normal';
       break;
     case 'EXC_HARD':
       this.category = 'hard';
+      break;
+    default:
+      this.category = 'unknown';
   }
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ff3cf61 and 4062218.

📒 Files selected for processing (90)
  • biome.json
  • lib/WorldState.ts
  • lib/models/Alert.ts
  • lib/models/Archimedea.ts
  • lib/models/Calendar.ts
  • lib/models/CambionCycle.ts
  • lib/models/CetusCycle.ts
  • lib/models/ChallengeInstance.ts
  • lib/models/ConclaveChallenge.ts
  • lib/models/ConstructionProgress.ts
  • lib/models/DailyDeal.ts
  • lib/models/DarkSector.ts
  • lib/models/DarkSectorBattle.ts
  • lib/models/DuviriCycle.ts
  • lib/models/EarthCycle.ts
  • lib/models/Fissure.ts
  • lib/models/FlashSale.ts
  • lib/models/GlobalUpgrade.ts
  • lib/models/Invasion.ts
  • lib/models/Kinepage.ts
  • lib/models/Kuva.ts
  • lib/models/MidrathCycle.ts
  • lib/models/Mission.ts
  • lib/models/News.ts
  • lib/models/Nightwave.ts
  • lib/models/NightwaveChallenge.ts
  • lib/models/PersistentEnemy.ts
  • lib/models/Reward.ts
  • lib/models/SentientOutpost.ts
  • lib/models/Simaris.ts
  • lib/models/Sortie.ts
  • lib/models/SortieVariant.ts
  • lib/models/SteelPathOffering.ts
  • lib/models/SyndicateJob.ts
  • lib/models/SyndicateMission.ts
  • lib/models/Tmp.ts
  • lib/models/VallisCycle.ts
  • lib/models/VoidTrader.ts
  • lib/models/VoidTraderItem.ts
  • lib/models/VoidTraderSchedule.ts
  • lib/models/WeeklyChallenge.ts
  • lib/models/WorldEvent.ts
  • lib/models/WorldStateObject.ts
  • lib/models/ZarimanCycle.ts
  • lib/models/index.ts
  • lib/supporting/Dependency.ts
  • lib/supporting/DuviriChoice.ts
  • lib/supporting/ExternalMission.ts
  • lib/supporting/FetchProxy.ts
  • lib/supporting/ImgCdn.ts
  • lib/supporting/KuvaLogEntry.ts
  • lib/supporting/RewardTypes.ts
  • lib/supporting/index.ts
  • main.ts
  • package.json
  • test/integration/integration.spec.ts
  • test/testclient.ts
  • test/unit/alert.spec.ts
  • test/unit/archimedea.spec.ts
  • test/unit/calendar.spec.ts
  • test/unit/cambion.spec.ts
  • test/unit/cetus.spec.ts
  • test/unit/conclavechallenge.spec.ts
  • test/unit/construction.spec.ts
  • test/unit/dailydeal.spec.ts
  • test/unit/darksector.spec.ts
  • test/unit/earth_cycle.spec.ts
  • test/unit/event.spec.ts
  • test/unit/fissure.spec.ts
  • test/unit/flashsale.spec.ts
  • test/unit/globalupgrade.spec.ts
  • test/unit/invasion.spec.ts
  • test/unit/kinepage.spec.ts
  • test/unit/kuva.spec.ts
  • test/unit/mission.spec.ts
  • test/unit/news.spec.ts
  • test/unit/nightwave.spec.ts
  • test/unit/persistentenemy.spec.ts
  • test/unit/reward.spec.ts
  • test/unit/sentientOutpost.spec.ts
  • test/unit/simaris.spec.ts
  • test/unit/sortie.spec.ts
  • test/unit/sortievariant.spec.ts
  • test/unit/syndicatejob.spec.ts
  • test/unit/syndicatemission.spec.ts
  • test/unit/system.spec.ts
  • test/unit/voidtrader.spec.ts
  • test/unit/worldstate.spec.ts
  • test/unit/zariman.spec.ts
  • tsconfig.json
✅ Files skipped from review due to trivial changes (1)
  • lib/supporting/RewardTypes.ts
🚧 Files skipped from review as they are similar to previous changes (29)
  • lib/supporting/ImgCdn.ts
  • lib/models/Kinepage.ts
  • test/unit/cetus.spec.ts
  • test/unit/news.spec.ts
  • test/unit/dailydeal.spec.ts
  • test/unit/persistentenemy.spec.ts
  • test/unit/syndicatemission.spec.ts
  • test/unit/invasion.spec.ts
  • test/unit/cambion.spec.ts
  • lib/models/VallisCycle.ts
  • lib/models/Tmp.ts
  • test/unit/construction.spec.ts
  • test/unit/conclavechallenge.spec.ts
  • test/unit/reward.spec.ts
  • package.json
  • test/unit/fissure.spec.ts
  • lib/models/MidrathCycle.ts
  • lib/models/Alert.ts
  • test/unit/event.spec.ts
  • lib/models/DailyDeal.ts
  • main.ts
  • lib/models/DuviriCycle.ts
  • test/unit/voidtrader.spec.ts
  • test/unit/earth_cycle.spec.ts
  • lib/models/VoidTraderItem.ts
  • test/unit/zariman.spec.ts
  • lib/models/Reward.ts
  • test/unit/flashsale.spec.ts
  • test/unit/alert.spec.ts
🧰 Additional context used
🧠 Learnings (4)
📚 Learning: 2025-10-16T02:24:30.860Z
Learnt from: SlayerOrnstein
Repo: WFCD/warframe-worldstate-parser PR: 702
File: lib/models/Archidemea.ts:74-90
Timestamp: 2025-10-16T02:24:30.860Z
Learning: In Warframe's Archimedea/Conquest data structure (lib/models/Archidemea.ts), Digital Extremes duplicates difficulties when adding hard tier risks. The first risk in higher difficulties (e.g., CD_HARD) is always identical to the one in the normal difficulty (CD_NORMAL), so using `slice(1)` to skip the first risk when processing additional difficulties is the correct approach to avoid duplicates.

Applied to files:

  • lib/models/Archimedea.ts
  • lib/models/DarkSectorBattle.ts
  • lib/models/Mission.ts
  • lib/WorldState.ts
  • lib/models/DarkSector.ts
  • lib/models/SortieVariant.ts
📚 Learning: 2025-08-21T23:39:46.622Z
Learnt from: SlayerOrnstein
Repo: WFCD/warframe-worldstate-parser PR: 654
File: biome.json:43-50
Timestamp: 2025-08-21T23:39:46.622Z
Learning: Biome's import organization feature is configured using the "assist" → "actions" → "source" → "organizeImports" structure in biome.json, NOT as a top-level "organizeImports" section. The correct minimal configuration is:

```json
"assist": {
  "enabled": true,
  "actions": {
    "source": {
      "organizeImports": "on"
    }
  }
}
```

This is according to Biome's official documentation at https://biomejs.dev/assist/actions/organize-imports/

Applied to files:

  • biome.json
📚 Learning: 2025-08-21T23:39:46.622Z
Learnt from: SlayerOrnstein
Repo: WFCD/warframe-worldstate-parser PR: 654
File: biome.json:43-50
Timestamp: 2025-08-21T23:39:46.622Z
Learning: In Biome configuration (biome.json), import organization should be configured using the "assist" block with nested "actions" → "source" → "organizeImports" structure, not as a top-level "organizeImports" section. The correct format is:
```json
"assist": {
  "enabled": true,
  "actions": {
    "source": {
      "organizeImports": "on"
    }
  }
}
```

Applied to files:

  • biome.json
📚 Learning: 2024-12-19T17:07:27.023Z
Learnt from: SlayerOrnstein
Repo: WFCD/warframe-worldstate-parser PR: 593
File: lib/models/Calendar.js:31-45
Timestamp: 2024-12-19T17:07:27.023Z
Learning: In `Calendar.js`, the constructor can safely assume `calendar.Days` is always present and an array, per user statement.

Applied to files:

  • test/unit/calendar.spec.ts
  • lib/models/Calendar.ts
🧬 Code graph analysis (31)
lib/models/Archimedea.ts (1)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
test/unit/syndicatejob.spec.ts (1)
lib/models/SyndicateJob.ts (2)
  • SyndicateJob (115-262)
  • RawSyndicateJob (95-105)
lib/models/CetusCycle.ts (1)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/models/ChallengeInstance.ts (1)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/models/Nightwave.ts (1)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/models/SyndicateJob.ts (2)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/models/SentientOutpost.ts (1)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/models/Kuva.ts (1)
lib/supporting/ExternalMission.ts (1)
  • ExternalMission (4-56)
lib/models/SyndicateMission.ts (3)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/models/SyndicateJob.ts (1)
  • SyndicateJob (115-262)
test/unit/sentientOutpost.spec.ts (2)
lib/models/SentientOutpost.ts (1)
  • SentientOutpost (40-94)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/models/CambionCycle.ts (1)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/models/Fissure.ts (2)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
test/unit/kuva.spec.ts (1)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/models/EarthCycle.ts (1)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
test/unit/archimedea.spec.ts (1)
lib/models/Archimedea.ts (2)
  • Archimedea (103-154)
  • RawArchimedea (20-24)
lib/models/NightwaveChallenge.ts (1)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/models/GlobalUpgrade.ts (2)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/models/FlashSale.ts (1)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/models/Mission.ts (2)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/models/Reward.ts (1)
  • Reward (32-109)
lib/models/Calendar.ts (1)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/models/ConclaveChallenge.ts (2)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/models/Sortie.ts (3)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/models/SortieVariant.ts (1)
  • SortieVariant (21-76)
lib/WorldState.ts (6)
lib/models/WorldStateObject.ts (2)
  • BaseContentObject (14-18)
  • WorldStateObject (23-79)
lib/models/SteelPathOffering.ts (1)
  • SteelPathOfferings (86-119)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/models/WorldEvent.ts (2)
  • WorldEvent (92-389)
  • RawWorldEvent (47-86)
lib/models/SyndicateMission.ts (2)
  • SyndicateMission (23-96)
  • RawSyndicateMission (13-17)
lib/models/WeeklyChallenge.ts (1)
  • WeeklyChallenge (15-27)
lib/models/DarkSector.ts (4)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/models/Mission.ts (1)
  • Mission (40-230)
lib/models/DarkSectorBattle.ts (1)
  • DarkSectorBattle (22-79)
lib/models/VoidTrader.ts (4)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/models/VoidTraderItem.ts (1)
  • VoidTraderItem (14-46)
lib/models/VoidTraderSchedule.ts (1)
  • VoidTraderSchedule (9-20)
lib/models/Invasion.ts (3)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/models/Reward.ts (1)
  • Reward (32-109)
lib/models/WorldEvent.ts (2)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/models/News.ts (2)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/supporting/ImgCdn.ts (2)
  • deProxy (7-14)
  • cdn (1-2)
lib/models/SortieVariant.ts (1)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/models/ConstructionProgress.ts (1)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/models/PersistentEnemy.ts (1)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Test (20)
🔇 Additional comments (81)
lib/models/DarkSectorBattle.ts (1)

1-79: LGTM! Clean refactor to named export.

The conversion from default export to named export is consistent with the PR's objective to standardize the public API surface. The import of Identifier from WorldStateObject correctly reflects the renamed base class, and the class logic remains intact.

lib/supporting/Dependency.ts (1)

9-39: LGTM! Dependency interface converted to named export.

The change from default export to named export aligns with the PR's goal of standardizing the public API. The interface definition remains unchanged, preserving all existing functionality.

lib/models/ChallengeInstance.ts (1)

18-68: LGTM! Clean refactor to named export with improved formatting.

The conversion to named export is consistent with PR objectives. The constructor parameter formatting improvements enhance readability without altering functionality.

test/unit/nightwave.spec.ts (2)

3-5: LGTM! Test imports updated to use path aliases.

The imports correctly use the new path aliases (@/models, @/supporting, @/data) and named exports, aligning with the PR's refactoring objectives.


35-35: Minor formatting improvement.

Added semicolon for consistency.

test/unit/sortievariant.spec.ts (1)

3-3: LGTM! Test imports updated to use path aliases.

The import correctly uses the @/models path alias and named exports for both SortieVariant and RawSortieVariant, aligning with the PR's refactoring objectives.

lib/models/SortieVariant.ts (2)

1-9: LGTM! Import formatting improved.

The multi-line import formatting from warframe-worldstate-data/utilities enhances readability. The Dependency import uses the @/supporting/Dependency alias correctly.


21-76: LGTM! Clean refactor to named export.

The conversion from default export to named export is consistent with the PR's objective. Constructor parameter formatting improvements enhance readability without changing functionality.

lib/supporting/KuvaLogEntry.ts (1)

1-19: LGTM! Formatting consistency improvements.

The changes add semicolons and normalize spacing in the interface definitions, improving code style consistency without altering functionality.

lib/models/SteelPathOffering.ts (2)

3-6: LGTM! Import formatting improved.

Multi-line import formatting enhances readability.


86-118: LGTM! Well-structured class with clear initialization logic.

The conversion to a named export (SteelPathOfferings) is consistent with PR objectives. The class aggregates SteelPathOffering items from the external data package and provides a clean interface for steel path rotation data. The constructor logic for calculating the current rotation index and time windows is sound.

biome.json (1)

51-77: LGTM! Import organization configuration follows the correct Biome structure.

The nested assist.actions.source.organizeImports structure is correct per Biome's documentation. The import groups properly reflect the path aliases (@/models, @/supporting, @/data) introduced in this PR. Based on learnings, this is the proper way to configure import organization in Biome.

lib/models/NightwaveChallenge.ts (1)

7-21: LGTM! Named export and WorldStateObject base class are correctly applied.

The changes align with the PR's goal of exporting types for external usage:

  • Import updated to use named WorldStateObject export
  • JSDoc @augments annotation updated to match the renamed class
  • Class now uses named export pattern
lib/models/PersistentEnemy.ts (1)

10-29: LGTM! Consistent with the PR's export refactoring pattern.

The changes properly:

  • Import WorldStateObject and BaseContentObject as named exports
  • Update the @augments JSDoc to reference the renamed base class
  • Convert to named class export

This is consistent with other model files in this PR.

lib/WorldState.ts (3)

6-61: LGTM! Consolidated barrel imports improve maintainability.

The refactoring from individual model imports to a consolidated @/models barrel import is clean and aligns with the PR's goal of exposing a unified public API. The @/supporting imports are similarly well-structured.


394-402: Good: Explicit generic parameters improve type inference.

Adding explicit type parameters <WorldEvent, RawWorldEvent> and <SyndicateMission, RawSyndicateMission> to the parseAsyncArray calls improves code clarity and ensures proper type inference.


336-336: The SteelPathOfferings type is correct and matches the exported class name.

The exported class from lib/models/SteelPathOffering.ts is SteelPathOfferings (plural), and the type annotation at line 336 correctly uses SteelPathOfferings.

test/unit/simaris.spec.ts (1)

3-3: LGTM! Test import updated to use the new named export and path alias.

The change from import Simaris from '../../lib/models/Simaris.js' to import { Simaris } from '@/models' correctly reflects:

  • The model's conversion to a named export
  • The project's adoption of path aliases
test/unit/mission.spec.ts (1)

3-4: LGTM! Test imports correctly use path aliases for both models and data.

The imports are updated to:

  • Use named export { Mission, type RawMission } from @/models
  • Use the @/data alias for test data with proper JSON import attributes

This is consistent with other test file updates in the PR.

lib/models/EarthCycle.ts (3)

3-3: LGTM! Import updated for WorldStateObject rename.

The import correctly reflects the renamed base class and the shift to named exports.


56-58: LGTM! Multi-line formatting for readability.

The calculation logic remains unchanged; the reformatting improves readability.


84-86: LGTM! Class export and documentation updated.

The changes correctly:

  • Update JSDoc to reference WorldStateObject
  • Change from default export to named export
  • Extend the renamed WorldStateObject class

These align with the PR's public API surface refactor.

test/unit/calendar.spec.ts (2)

4-5: LGTM! Imports updated to use path aliases.

The imports correctly use the configured path aliases (@/models and @/data) and reflect the shift to named exports for Calendar.


16-22: LGTM! Multi-line formatting for readability.

The test assertions remain semantically identical; the formatting improves readability.

test/unit/worldstate.spec.ts (1)

5-7: LGTM! Imports updated to use path aliases.

The imports correctly use the configured path aliases and reflect the WorldStateObject rename and shift to named exports.

test/unit/sortie.spec.ts (1)

3-3: LGTM! Import updated to use path alias.

The import correctly uses the configured @/models alias and reflects the shift to named exports.

test/testclient.ts (3)

1-2: LGTM! Import paths updated to .mjs variants.

The imports correctly point to the compiled .mjs files in the dist directory.


5-10: LGTM! Multi-line formatting for fetch calls.

The reformatting improves readability without changing the fetch logic.


14-17: LGTM! Explicit process exit codes added.

Adding explicit exit codes is good practice for test clients, ensuring proper termination status reporting.

lib/supporting/ExternalMission.ts (1)

4-4: LGTM! Interface export updated to named export.

The change from default export to named export aligns with the PR's goal to improve the public API surface and enable better tree-shaking.

lib/models/WorldStateObject.ts (3)

1-7: LGTM! Multi-line import formatting.

The reformatting improves readability and clearly lists all imported utilities.


21-23: LGTM! Class export and documentation updated.

The changes correctly:

  • Update JSDoc to reference "WorldState" generically
  • Change from default export to named export for WorldStateObject

This is a critical change as WorldStateObject serves as the base class for many models across the codebase.


30-35: LGTM! Documentation updated for consistency.

The JSDoc comments now consistently reference WorldStateObject, aligning with the class naming.

tsconfig.json (1)

14-22: LGTM! Path aliases configured for cleaner imports.

The path aliases are well-structured and enable the cleaner import syntax used throughout the codebase. The configuration correctly maps:

  • @/models to the models barrel and individual model files
  • @/supporting to the supporting barrel and files
  • @/data/* to test data
  • @/* as a general lib directory alias
test/unit/kinepage.spec.ts (1)

4-4: LGTM!

The migration to the centralized barrel import with a named export aligns perfectly with the PR's objective to expose types and aliases for external usage.

test/unit/syndicatejob.spec.ts (2)

3-10: LGTM!

The migration to alias-based imports with JSON import attributes is clean and consistent with the broader refactoring objectives.


20-30: LGTM!

The multiline formatting of constructor invocations improves readability.

test/unit/darksector.spec.ts (1)

3-3: LGTM!

The switch to named imports from the centralized barrel is consistent with the PR's refactoring objectives.

test/unit/globalupgrade.spec.ts (1)

3-3: LGTM!

The migration to alias-based named imports is consistent with the broader refactoring pattern.

lib/models/Simaris.ts (1)

13-13: LGTM!

The conversion from default export to named export aligns with the PR's objective to improve the public API surface.

lib/supporting/index.ts (1)

1-8: LGTM!

The barrel export consolidates supporting modules into a single entry point, enabling cleaner imports across the codebase and better external API exposure.

test/unit/kuva.spec.ts (2)

3-5: LGTM!

The migration to alias-based imports with JSON import attributes is clean and consistent with the centralized API pattern.


9-9: LGTM!

Minor formatting improvement to the type annotation.

test/unit/archimedea.spec.ts (2)

4-5: LGTM!

The migration to alias-based imports is consistent with the broader refactoring pattern.


13-23: LGTM!

The test correctly uses the Archimedea class through the centralized barrel import.

lib/models/ZarimanCycle.ts (1)

3-3: LGTM! Export refactoring applied correctly.

The changes properly update the base class import to use the renamed WorldStateObject and convert to a named export, consistent with the PR's objective to expose more types for external usage.

Also applies to: 23-25

lib/models/ConclaveChallenge.ts (1)

12-12: LGTM! Base class and export updated correctly.

The changes properly update to use WorldStateObject and convert to a named export, consistent with the PR's refactoring objectives.

Also applies to: 25-27

lib/models/Invasion.ts (1)

10-13: LGTM! Import paths and export refactoring applied correctly.

The changes properly update imports to use path aliases and convert to a named export, aligning with the PR's objective to expose more types for external usage.

Also applies to: 51-51

lib/models/ConstructionProgress.ts (1)

3-3: LGTM! Export refactoring applied correctly.

The changes properly update to use the renamed WorldStateObject and convert to a named export, consistent with the PR's objectives.

Also applies to: 7-9

lib/models/Archimedea.ts (1)

11-13: LGTM! Import paths and export refactoring applied correctly.

The changes properly update imports to use path aliases and convert to a named export, consistent with the PR's refactoring objectives.

Also applies to: 103-103

test/integration/integration.spec.ts (1)

9-11: LGTM! Test imports updated to use path aliases.

The changes properly update test imports to use the new path aliases, aligning with the PR's refactoring to improve import paths across the codebase.

lib/supporting/DuviriChoice.ts (1)

1-1: LGTM! Import path and export refactoring applied correctly.

The changes properly update the import to use the models barrel export and convert to a named export, consistent with the PR's objectives.

Also applies to: 11-11

test/unit/sentientOutpost.spec.ts (1)

4-5: LGTM! Test imports updated to use path aliases.

The changes properly update test imports to use the new path aliases, consistent with the PR's refactoring objectives.

lib/models/CetusCycle.ts (2)

2-3: LGTM!

The refactoring to named exports and the updated WorldStateObject import (capital S) aligns with the PR's goal of standardizing exports for external usage. The class correctly extends the base class with proper JSDoc updates.

Also applies to: 23-23, 25-25


103-110: Formatting improvements look good.

The multiline ternary and Date construction improve readability without changing behavior.

test/unit/system.spec.ts (2)

2-7: LGTM!

The migration to path aliases (@/supporting, @/data/...) improves import clarity and aligns with the project-wide alias standardization. The fetchProxy as fetch rename maintains backward-compatible usage.


15-18: Formatting adjustment is fine.

The multiline object parameter improves readability without changing behavior.

lib/models/VoidTraderSchedule.ts (1)

1-5: Named export and multiline import formatting look good.

The class export change aligns with the PR's standardization effort.

Also applies to: 9-9

lib/models/CambionCycle.ts (2)

3-4: LGTM!

The migration to named exports and WorldStateObject (capital S) is correctly implemented. Using import type for CetusCycle is appropriate since it's only used as a type annotation.

Also applies to: 8-8, 10-10


20-24: Destructuring assignment formatting is clean.

The multiline formatting improves readability of the property extraction from cetusCycle.

lib/models/Kuva.ts (2)

6-7: Path alias imports look correct.

The @/supporting/ExternalMission and @/supporting/KuvaLogEntry imports use the proper alias format.


37-38: LGTM!

The reformatting changes improve readability, and the named export aligns with the PR's standardization effort.

Also applies to: 47-50, 63-63, 93-93

lib/models/Calendar.ts (2)

5-8: LGTM!

Import restructuring correctly adds translateSeason and imports WorldStateObject with BaseContentObject type from the local module.


44-45: Formatting and export changes look good.

The multiline formatting improves readability, and the named export pattern is consistent with the PR's goals. Based on learnings, calendar.Days is always present and an array, so the existing null-check in the constructor remains appropriately defensive.

Also applies to: 57-60, 65-65, 85-85

lib/models/FlashSale.ts (2)

8-10: LGTM!

The imports correctly use the @/supporting alias for Dependency and a relative path for the local WorldStateObject module. This is the expected pattern for cross-module vs same-directory imports.


27-27: Named export and constructor formatting look good.

The refactoring to a named export is consistent with the PR's standardization effort. The multiline constructor signature improves readability.

Also applies to: 73-77

lib/models/WeeklyChallenge.ts (2)

1-5: LGTM!

The multiline import formatting improves readability. The named export and WorldStateObject base class are correctly implemented with updated JSDoc.

Also applies to: 13-13, 15-15


23-25: Formatting improvement is clean.

The multiline map callback formatting is more readable.

lib/models/SentientOutpost.ts (1)

40-93: LGTM!

The conversion to named export and the addition of explicit public properties align well with the PR objectives. The data-driven override logic for activation and expiry (lines 87-92) correctly provides defaults from sat() that can be superseded by sentientData when available.

lib/models/Mission.ts (1)

40-230: LGTM!

The conversion to named export and the formatting adjustments preserve all behavior while improving consistency. The multiline formatting for array mappings (lines 206-227) enhances readability.

lib/models/Sortie.ts (1)

29-92: LGTM!

The base class update to WorldStateObject and the conversion to named export are consistent with the project-wide refactor. The multiline formatting for the variants mapping (lines 81-83) improves readability.

lib/models/VoidTrader.ts (2)

10-10: Correct import path pattern observed.

This file uses @/supporting (without the ./ prefix), which differs from the ./@/supporting/Dependency pattern in SentientOutpost.ts, Mission.ts, and Sortie.ts. This suggests those files have incorrect import paths.

The verification script from the earlier comment will help identify all instances of the inconsistent pattern.


29-92: LGTM!

The conversion to named export and the base class update to WorldStateObject are consistent with the refactor. The character handling logic (lines 78-80) correctly maintains the fallback behavior, and the multiline array mappings improve readability.

lib/models/Nightwave.ts (1)

27-87: LGTM!

The base class update to WorldStateObject and the conversion to named export align with the project-wide refactor. The JSDoc description update (line 24) correctly addresses the previous review feedback.

lib/models/DarkSector.ts (1)

48-225: LGTM!

The base class update to WorldStateObject, the conversion to named export, and the multiline formatting adjustments all preserve existing behavior while improving consistency with the project-wide refactor.

lib/models/Fissure.ts (1)

31-138: LGTM!

The base class update to WorldStateObject and the new public property initializations (lines 116-122) are correct. The conversion to named export and multiline formatting improve consistency.

lib/models/SyndicateJob.ts (1)

115-261: LGTM!

The base class update to WorldStateObject and conversion to named export are consistent with the refactor. The chamber extraction logic (lines 228-232) correctly addresses the ReDoS vulnerability from the previous review by replacing the problematic backtracking regex with two safe replacements.

lib/models/News.ts (1)

10-13: LGTM! Refactoring improves public API and maintainability.

The changes successfully:

  • Convert to named export for better tree-shaking and explicit imports
  • Fix the naming inconsistency (WorldstateObject → WorldStateObject)
  • Adopt path aliases (@/supporting) for cleaner import paths
  • Improve code readability with multiline formatting

These are consistent with the PR's objective to export more types and improve the public API surface.

Also applies to: 34-36, 91-99, 101-105, 112-116, 119-121, 132-136, 187-189

lib/models/SyndicateMission.ts (1)

1-11: LGTM! Refactoring aligns with broader API improvements.

The changes successfully:

  • Convert to named export (export class SyndicateMission)
  • Fix the WorldstateObject → WorldStateObject naming
  • Adopt path aliases for imports (@/supporting)
  • Improve readability with multiline method signatures

These changes are consistent with the PR's goal of making types and classes available for external usage.

Also applies to: 21-23, 54-57, 60-64, 77-80

lib/models/WorldEvent.ts (1)

11-19: LGTM! Refactoring successfully improves the public API.

The changes effectively:

  • Convert to named export (export class WorldEvent)
  • Fix WorldstateObject → WorldStateObject naming throughout
  • Adopt path aliases (@/supporting) for cleaner imports
  • Improve code readability with multiline formatting for long expressions

These changes align with the PR's objective of exporting types for external usage.

Also applies to: 90-92, 233-236, 261-264, 281-283, 287-289, 291-293, 295-297, 306-308, 354-356, 358-360

lib/models/index.ts (1)

1-42: LGTM! Central barrel export improves developer experience.

This new index file creates a unified public API entry point for all model classes and types. The barrel export pattern:

  • Enables clean imports: import { News, Alert, WorldEvent } from '@/models'
  • Centralizes the public API surface
  • Supports the path alias strategy used throughout the codebase
  • Makes it easier for external consumers to import multiple models

This directly fulfills the PR's objective of "export more types and import aliases to allow external usage."

@TobiTenno TobiTenno enabled auto-merge (squash) December 29, 2025 20:30
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

♻️ Duplicate comments (1)
lib/models/WorldEvent.ts (1)

343-350: Bug fix applied successfully; consider simplifying the outer wrapper.

The string concatenation bug flagged in the previous review has been correctly fixed by adding an initial value of 0 and converting each element to a number. However, the outer String() and Number.parseFloat() wrapper is redundant since the reduce already returns a number.

🔎 Suggested simplification
-      this.progressTotal = Number.parseFloat(
-        String(
-          data.MultiProgress!.reduce(
-            (acc, val) => acc + Number.parseFloat(val),
-            0
-          )
-        )
-      );
+      this.progressTotal = data.MultiProgress!.reduce(
+        (acc, val) => acc + Number.parseFloat(val),
+        0
+      );
🧹 Nitpick comments (4)
lib/models/Fissure.ts (2)

117-119: Potential code duplication with base class.

The base class WorldStateObject already handles activation and expiry in its constructor (called via super(data) on line 92). These lines reassign the same fields, duplicating the parsing logic.

Since RawFissure defines Activation and Expiry as required fields, these assignments will always execute. Consider whether these lines can be removed to rely on the base class implementation, or if there's a specific reason Fissure needs to override this behavior.

🔎 Verification script to check if other models also reassign these fields
#!/bin/bash
# Check if other model classes that extend WorldStateObject also reassign activation/expiry

ast-grep --pattern $'class $_ extends WorldStateObject {
  $$$
  constructor($$$) {
    $$$
    this.activation = $$$
    $$$
  }
  $$$
}'

129-138: Consider defensive null handling in getters.

Both getters use non-null assertions (this.expiry!), which assume expiry is always defined. While this is likely safe given that RawFissure requires Expiry, consider adding defensive checks for robustness:

get expired(): boolean {
  return this.expiry ? fromNow(this.expiry) < 0 : false;
}

get eta(): string {
  return this.expiry ? timeDeltaToString(fromNow(this.expiry)) : '';
}

This would prevent runtime errors if expiry is unexpectedly undefined.

lib/models/GlobalUpgrade.ts (1)

10-11: Consider using the barrel export for consistency.

The import path has been corrected from the malformed ./@/supporting/Dependency to @/supporting/Dependency and resolves correctly. However, the barrel export at @/supporting includes Dependency, so the import can be simplified to import type { Dependency } from '@/supporting'; for consistency with the project's export patterns.

lib/supporting/DuviriChoice.ts (1)

17-23: Consider adding a default case for defensive coding.

While the RawChoice interface constrains Category to only two values, adding a default case would provide runtime safety if the API returns unexpected data.

🔎 Proposed defensive default case
 switch (data.Category) {
   case 'EXC_NORMAL':
     this.category = 'normal';
     break;
   case 'EXC_HARD':
     this.category = 'hard';
+    break;
+  default:
+    this.category = 'unknown';
 }
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4062218 and 9ce190f.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (18)
  • lib/models/ChallengeInstance.ts
  • lib/models/ConclaveChallenge.ts
  • lib/models/DailyDeal.ts
  • lib/models/DuviriCycle.ts
  • lib/models/Fissure.ts
  • lib/models/GlobalUpgrade.ts
  • lib/models/Kuva.ts
  • lib/models/Mission.ts
  • lib/models/Reward.ts
  • lib/models/SentientOutpost.ts
  • lib/models/Simaris.ts
  • lib/models/Sortie.ts
  • lib/models/Tmp.ts
  • lib/models/VoidTraderSchedule.ts
  • lib/models/WorldEvent.ts
  • lib/supporting/DuviriChoice.ts
  • package.json
  • test/testclient.ts
🚧 Files skipped from review as they are similar to previous changes (6)
  • package.json
  • lib/models/Kuva.ts
  • lib/models/Tmp.ts
  • lib/models/DuviriCycle.ts
  • lib/models/Reward.ts
  • test/testclient.ts
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-16T02:24:30.860Z
Learnt from: SlayerOrnstein
Repo: WFCD/warframe-worldstate-parser PR: 702
File: lib/models/Archidemea.ts:74-90
Timestamp: 2025-10-16T02:24:30.860Z
Learning: In Warframe's Archimedea/Conquest data structure (lib/models/Archidemea.ts), Digital Extremes duplicates difficulties when adding hard tier risks. The first risk in higher difficulties (e.g., CD_HARD) is always identical to the one in the normal difficulty (CD_NORMAL), so using `slice(1)` to skip the first risk when processing additional difficulties is the correct approach to avoid duplicates.

Applied to files:

  • lib/models/ChallengeInstance.ts
  • lib/models/Mission.ts
🧬 Code graph analysis (8)
lib/models/ChallengeInstance.ts (1)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/models/SentientOutpost.ts (1)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/models/Fissure.ts (2)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/models/DailyDeal.ts (2)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/models/WorldEvent.ts (2)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/models/Sortie.ts (3)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/models/SortieVariant.ts (1)
  • SortieVariant (21-76)
lib/models/Mission.ts (3)
lib/models/SentientOutpost.ts (1)
  • Mission (30-34)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/models/Reward.ts (1)
  • Reward (31-108)
lib/models/ConclaveChallenge.ts (2)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Test (20)
  • GitHub Check: Coverage
🔇 Additional comments (29)
lib/models/Simaris.ts (2)

2-3: LGTM!

The import path has been correctly updated to use the alias-based path @/supporting/Dependency, aligning with the PR's goal of enabling external usage through path aliases. The previously flagged malformed path issue has been resolved.


13-18: LGTM!

The change from default export to named export aligns with the PR's broader refactoring goal. Consumers will need to update from import Simaris from '...' to import { Simaris } from '...', but this is intentional and the barrel export in lib/models/index.ts will properly re-export the class.

lib/models/ConclaveChallenge.ts (3)

10-13: Import paths look correct.

The path alias @/supporting/Dependency is properly formatted (the previously reported ./@/ issue has been addressed). The combination of alias imports for supporting modules and relative imports for sibling model files is reasonable.


26-28: Named export and base class alignment look good.

The switch from default to named export enables cleaner imports for external consumers. The WorldStateObject capitalization now matches the actual class definition.


79-82: Formatting improvements.

The multiline formatting for the constructor signature and object destructuring enhances readability without changing behavior.

Also applies to: 103-107

lib/models/WorldEvent.ts (2)

11-19: Import restructuring looks good.

The updated imports correctly use the new path aliases (@/supporting) and named exports, aligning with the PR objectives to enable external usage of common/shared types.


90-92: Export style and base class updates are correct.

The change from default to named export and the base class rename from WorldstateObject to WorldStateObject align with the PR objectives. The JSDoc @augments annotation is correctly updated to match.

lib/models/ChallengeInstance.ts (2)

3-3: Import path issue resolved.

The import correctly uses the @/ alias without the ./ prefix, addressing the previous review feedback.


18-18: Named export migration verified correctly.

The change to named export in ChallengeInstance.ts is properly implemented. The consumer file (WeeklyChallenge.ts) correctly imports using named syntax: import { ChallengeInstance, type RawChallengeInstance } from './ChallengeInstance'. The barrel export in lib/models/index.ts also properly re-exports the named export. No violations found.

lib/models/VoidTraderSchedule.ts (2)

1-5: LGTM!

The import restructuring is clean and properly uses the type modifier for the type-only import of ContentTimestamp.


9-9: LGTM!

The migration from default export to named export aligns with the PR objectives to "export more types" and enables better external usage of this model.

lib/models/DailyDeal.ts (3)

72-75: LGTM!

The constructor signature reformatting improves readability without changing semantics. The defensive default parameter pattern correctly handles both undefined deps parameter and undefined locale property.


26-26: LGTM! All imports correctly use the named import pattern.

The class declaration correctly extends WorldStateObject and uses a named export. The single import found in the test file (test/unit/dailydeal.spec.ts) properly imports using the named pattern from the barrel export, and no incorrect default imports exist.


8-10: Approved. The import changes correctly adopt the @/supporting/ path alias for the Dependency type and properly reference the renamed WorldStateObject base class. The @/ path alias is properly configured in tsconfig.json, and DailyDeal is correctly exported as a named export through the lib/models/index.ts barrel file.

lib/models/Fissure.ts (3)

13-16: LGTM! Import aliases and named imports look good.

The updated imports correctly use path aliases (@/supporting/Dependency) and named imports (WorldStateObject), which aligns with the PR's objective to enable better external usage and maintainability.


32-32: LGTM! Named export aligns with PR objectives.

The change from default export to named export (export class Fissure) enables explicit imports and better tree-shaking for external consumers.


88-91: LGTM! Formatting improvements enhance readability.

The constructor parameter formatting and multi-line assignments improve code readability without affecting functionality.

Also applies to: 96-102, 110-113

lib/models/SentientOutpost.ts (3)

1-7: LGTM!

The import changes are correct. Named imports from warframe-worldstate-data/utilities and the type-only import using the @/supporting/Dependency alias are properly structured.


11-25: Comment-code discrepancy in sat() function.

The comment on line 13 says "One cycle = 3 hours" but duration is 1800 seconds (30 minutes). Additionally, the comment on line 15 mentions "active range is after 30m and lasts for 30m" but the condition cycleSeconds > 0 && cycleSeconds < 1800 makes active true for nearly the entire cycle (1-1799 seconds), only false at the exact start (0).

Please verify if this logic is intentional or if the comments/logic need updating.


30-34: LGTM!

The Mission interface and SentientOutpost class are correctly exported as named exports. The class properly initializes all public fields and handles the optional sentientData override for activation/expiry dates.

Also applies to: 40-93

lib/models/Sortie.ts (2)

10-15: LGTM!

Import statements are well-organized with type-only imports properly using the type keyword and the @/supporting/Dependency path alias. Named imports for Mission, SortieVariant, and WorldStateObject align with the broader named export refactoring.


26-30: LGTM!

The JSDoc @augments annotation correctly references the renamed WorldStateObject. Constructor and variants mapping reformatting improves readability without changing behavior.

Also applies to: 66-69, 82-84

lib/models/Mission.ts (2)

1-11: LGTM!

Import statements are correctly structured with named imports from warframe-worldstate-data/utilities, type-only import for Dependency using the path alias, and properly organized local imports.


166-169: LGTM!

Constructor and field assignment reformatting improves readability. The multiline formatting for conditional assignments and array mappings follows consistent patterns without changing behavior.

Also applies to: 187-189, 207-227

lib/models/GlobalUpgrade.ts (4)

1-8: LGTM! Missing import added.

The upgrade function was being used at line 57 but wasn't previously imported. This change correctly adds it to the import statement.


51-54: LGTM! Formatting improvement.

The constructor parameters have been formatted to span multiple lines for better readability. No functional changes.


12-12: Base class rename is complete and consistent.

The import of WorldStateObject and BaseContentObject from ./WorldStateObject is correct. The file exists, properly exports both the class and interface, and there are no remaining references to the old WorldstateObject naming throughout the codebase.


25-25: Export change verified - all consumers properly updated.

The conversion from default to named export has been successfully implemented across the codebase. Verification confirms no remaining default imports exist, and all files now use the correct named import pattern:

  • import { GlobalUpgrade, type RawGlobalUpgrade } from '@/models'

Tests and the main WorldState.ts consumer have been properly updated.

lib/supporting/DuviriChoice.ts (1)

11-11: All imports correctly use named import syntax.

Verification confirms that DuviriChoice has been successfully converted to a named export (line 11: export class DuviriChoice), is properly re-exported through the barrel file, and all import sites are correctly updated:

  • lib/WorldState.ts: import { DuviriChoice, type RawChoice } from '@/supporting'
  • lib/models/DuviriCycle.ts: import type { DuviriChoice } from '@/supporting/DuviriChoice'

No remaining default imports found.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (4)
test/unit/simaris.spec.ts (1)

18-20: Double type cast bypasses type safety.

The test uses {} as unknown as undefined to bypass TypeScript's type checking. While this may intentionally test edge-case behavior, the double cast is a code smell.

Consider either:

  • Removing this test if passing an empty object is not a valid use case
  • Using a single cast if the intent is to test runtime behavior with unexpected types
test/unit/fissure.spec.ts (1)

10-15: LGTM! Consider adding positive test cases.

The test assertions correctly verify that the constructor throws TypeError with invalid inputs using proper chai syntax.

While the error case coverage is good, consider adding tests for valid constructor behavior to ensure the Fissure class properly initializes its properties (node, missionType, enemy, tier, etc.) with valid RawFissure data. This would provide more comprehensive coverage.

Example test structure for valid input
it('should create a Fissure instance with valid data', () => {
  const mockData: RawFissure = {
    Node: 'SolNode1',
    MissionType: 'MT_EXCAVATE',
    Modifier: 'VoidT1',
    ActiveMissionTier: '',
    Activation: { sec: 1234567890 },
    Expiry: { sec: 1234567900 }
  };
  
  const fissure = new Fissure(mockData);
  
  expect(fissure.node).to.be.a('string');
  expect(fissure.missionType).to.be.a('string');
  expect(fissure.tier).to.be.a('string');
});
test/unit/darksector.spec.ts (1)

5-14: LGTM! Expect-style assertions properly formed.

The assertions are correctly converted to expect-style. The .to.throw() calls without specific error types are valid, though slightly less specific than other test files that check for TypeError.

💡 Optional: Add specific error type for clarity

For consistency with other test files (e.g., flashsale.spec.ts, mission.spec.ts), consider specifying TypeError:

      expect(() => {
        new DarkSector(undefined as unknown as RawDarkSector);
-      }).to.throw();
+      }).to.throw(TypeError);
      expect(() => {
        new DarkSector({} as RawDarkSector);
-      }).to.throw();
+      }).to.throw(TypeError);
lib/models/SentientOutpost.ts (1)

9-25: Consider removing unused active field from sat() return value.

The sat() function calculates and returns an active boolean (line 16, 21), but the constructor only destructures activation and expiry (line 83), leaving the active field unused. The class instead sets its own active based on mission presence (line 84).

This creates confusion between two different concepts of "active": time-based vs. mission-based.

🔎 Proposed refactor
 const sat = () => {
   const now = Math.floor(Date.now() / 1000);
   // One cycle = 3 hours
   const cycleSeconds = now % duration;
-  // active range is after 30m and lasts for 30m
-  const active = cycleSeconds > 0 && cycleSeconds < 1800;
   const start = (now - cycleSeconds) * 1000;
   const end = (now - cycleSeconds + duration) * 1000;
 
   return {
-    active,
     expiry: new Date(end),
     activation: new Date(start),
   };
 };
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9ce190f and 13b1510.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (39)
  • lib/models/SentientOutpost.ts
  • lib/supporting/DuviriChoice.ts
  • lib/supporting/KuvaLogEntry.ts
  • package.json
  • test/data/LanguageNews.json
  • test/data/News.json
  • test/integration/integration.spec.ts
  • test/unit/alert.spec.ts
  • test/unit/archimedea.spec.ts
  • test/unit/calendar.spec.ts
  • test/unit/cambion.spec.ts
  • test/unit/cetus.spec.ts
  • test/unit/conclavechallenge.spec.ts
  • test/unit/construction.spec.ts
  • test/unit/dailydeal.spec.ts
  • test/unit/darksector.spec.ts
  • test/unit/earth_cycle.spec.ts
  • test/unit/event.spec.ts
  • test/unit/fissure.spec.ts
  • test/unit/flashsale.spec.ts
  • test/unit/globalupgrade.spec.ts
  • test/unit/invasion.spec.ts
  • test/unit/kinepage.spec.ts
  • test/unit/kuva.spec.ts
  • test/unit/mission.spec.ts
  • test/unit/news.spec.ts
  • test/unit/nightwave.spec.ts
  • test/unit/persistentenemy.spec.ts
  • test/unit/reward.spec.ts
  • test/unit/sentientOutpost.spec.ts
  • test/unit/simaris.spec.ts
  • test/unit/sortie.spec.ts
  • test/unit/sortievariant.spec.ts
  • test/unit/syndicatejob.spec.ts
  • test/unit/syndicatemission.spec.ts
  • test/unit/system.spec.ts
  • test/unit/voidtrader.spec.ts
  • test/unit/worldstate.spec.ts
  • test/unit/zariman.spec.ts
🚧 Files skipped from review as they are similar to previous changes (17)
  • test/unit/calendar.spec.ts
  • test/unit/nightwave.spec.ts
  • test/unit/earth_cycle.spec.ts
  • test/unit/cambion.spec.ts
  • test/integration/integration.spec.ts
  • test/unit/kuva.spec.ts
  • test/unit/kinepage.spec.ts
  • test/unit/alert.spec.ts
  • test/unit/worldstate.spec.ts
  • test/unit/invasion.spec.ts
  • test/unit/sortievariant.spec.ts
  • test/unit/dailydeal.spec.ts
  • lib/supporting/KuvaLogEntry.ts
  • test/unit/system.spec.ts
  • test/unit/globalupgrade.spec.ts
  • test/unit/zariman.spec.ts
  • test/unit/sentientOutpost.spec.ts
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-16T02:24:30.860Z
Learnt from: SlayerOrnstein
Repo: WFCD/warframe-worldstate-parser PR: 702
File: lib/models/Archidemea.ts:74-90
Timestamp: 2025-10-16T02:24:30.860Z
Learning: In Warframe's Archimedea/Conquest data structure (lib/models/Archidemea.ts), Digital Extremes duplicates difficulties when adding hard tier risks. The first risk in higher difficulties (e.g., CD_HARD) is always identical to the one in the normal difficulty (CD_NORMAL), so using `slice(1)` to skip the first risk when processing additional difficulties is the correct approach to avoid duplicates.

Applied to files:

  • test/unit/voidtrader.spec.ts
  • lib/supporting/DuviriChoice.ts
🧬 Code graph analysis (15)
test/unit/simaris.spec.ts (1)
lib/models/Simaris.ts (1)
  • Simaris (13-48)
test/unit/flashsale.spec.ts (1)
lib/models/FlashSale.ts (2)
  • FlashSale (27-109)
  • RawFlashSale (12-22)
test/unit/sortie.spec.ts (1)
lib/models/Sortie.ts (2)
  • Sortie (30-108)
  • RawSortie (19-24)
test/unit/syndicatejob.spec.ts (1)
lib/models/SyndicateJob.ts (2)
  • SyndicateJob (115-262)
  • RawSyndicateJob (95-105)
test/unit/persistentenemy.spec.ts (1)
lib/models/PersistentEnemy.ts (2)
  • PersistentEnemy (29-118)
  • RawPersistentEnemy (12-23)
test/unit/event.spec.ts (1)
lib/models/WorldEvent.ts (2)
  • WorldEvent (92-394)
  • RawWorldEvent (47-86)
test/unit/cetus.spec.ts (1)
lib/models/CetusCycle.ts (1)
  • CetusCycle (25-122)
test/unit/construction.spec.ts (1)
lib/models/ConstructionProgress.ts (1)
  • ConstructionProgress (9-30)
test/unit/reward.spec.ts (1)
lib/models/Reward.ts (3)
  • Reward (31-108)
  • RawReward (22-26)
  • getItemType (9-12)
test/unit/archimedea.spec.ts (1)
lib/models/Archimedea.ts (2)
  • Archimedea (103-154)
  • RawArchimedea (20-24)
lib/models/SentientOutpost.ts (1)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
test/unit/news.spec.ts (1)
lib/models/News.ts (2)
  • News (36-191)
  • RawNews (20-30)
test/unit/syndicatemission.spec.ts (1)
lib/models/SyndicateMission.ts (2)
  • SyndicateMission (23-96)
  • RawSyndicateMission (13-17)
test/unit/fissure.spec.ts (1)
lib/models/Fissure.ts (2)
  • Fissure (32-139)
  • RawFissure (18-26)
test/unit/mission.spec.ts (1)
lib/models/Mission.ts (2)
  • Mission (41-231)
  • RawMission (13-36)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Test (20)
  • GitHub Check: Coverage
🔇 Additional comments (54)
lib/supporting/DuviriChoice.ts (3)

1-1: LGTM: Import alias correctly configured.

The switch to the @/models path alias is valid and aligns with the broader refactor to use TypeScript path mappings for improved maintainability.


11-11: Named export enables external usage.

The switch from default to named export is intentional and aligns with the PR objective to enable external usage of common/shared types. This is a breaking change for existing consumers but improves API flexibility.


23-25: Previous review concern addressed.

The addition of the break statement and default case properly addresses the feedback from the previous review, preventing potential fallthrough and adding defensive error handling for unknown categories.

test/unit/simaris.spec.ts (1)

3-3: LGTM: Import path updated to use named export and path alias.

The change from a default import to a named import from '@/models' aligns with the PR's objective to expose types for external usage. The path alias is correctly configured in tsconfig.json and Simaris is properly re-exported from the lib/models barrel file.

test/unit/sortie.spec.ts (2)

5-5: LGTM! Assertion style migration is correct.

The migration from should to expect assertion style is implemented correctly and improves code clarity. The test logic remains unchanged and properly verifies that constructing a Sortie with invalid arguments throws a TypeError.

Also applies to: 10-15


3-3: Import changes look good.

The @/models path alias is properly configured in tsconfig.json (mapping to ./lib/models/index), and the barrel export at lib/models/index.ts correctly re-exports both Sortie and RawSortie. The use of the type modifier for RawSortie follows TypeScript best practices for type-only imports.

test/unit/cetus.spec.ts (2)

5-5: LGTM! Consistent assertion style refactoring.

The migration from chai's should to expect style is applied consistently throughout the test file. All assertion syntax is correct:

  • TypeError throwing tests use proper expect(() => {}).to.throw(TypeError) pattern
  • Boolean equality checks use expect(value).to.equal(true/false)
  • String inclusion checks use expect(value).to.include(string)

The test logic and coverage are preserved correctly.

Also applies to: 10-15, 21-21, 27-27, 32-32


3-3: LGTM! Path alias is correctly configured.

The import path change from relative to aliased import (@/models) correctly aligns with the PR objective of enabling external usage of common types. The path alias is properly configured in tsconfig.json to resolve @/models to ./lib/models/index, which re-exports CetusCycle. The named import syntax is appropriate for the refactored exports.

test/unit/archimedea.spec.ts (4)

9-9: LGTM!

Extracting expect from chai is the standard approach for expect-style assertions and improves code clarity.


14-14: LGTM!

The type casting to RawArchimedea is necessary and correct for JSON imports, and the constructor usage aligns with the class definition.


16-16: LGTM!

The migration to expect-style assertion is correctly implemented.


4-5: Path aliases and import attributes configuration is correctly set up.

The import statements follow the configured path aliases:

  • @/models correctly resolves to ./lib/models/index
  • @/data/Conquest.json correctly resolves to test/data/Conquest.json

TypeScript 5.9.3 fully supports the import attributes syntax (with { type: 'json' }), exceeding the minimum requirement of 5.3.

test/unit/persistentenemy.spec.ts (3)

5-5: LGTM!

Standard chai expect pattern that supports the new assertion style.


10-15: LGTM!

The migration from should() to expect() style assertions preserves the test logic while using more explicit syntax.


3-3: Import changes are properly configured.

The @/models path alias is correctly mapped to lib/models/index.ts in tsconfig.json, and the barrel export properly re-exports both PersistentEnemy and RawPersistentEnemy. The migration from relative default import to named imports from the alias is valid and aligns with the PR objectives.

package.json (2)

41-42: LGTM! Updated to use recommended Biome commands.

The change from biome lint to biome check is a best practice, as check runs both linting and formatting, providing more comprehensive code quality checks.


46-46: LGTM! Necessary for path alias support.

Adding the pretest build step is appropriate given the introduction of TypeScript path aliases mentioned in the PR. This ensures tests run against properly built code with resolved module paths.

test/unit/voidtrader.spec.ts (2)

3-4: LGTM! Import changes align with PR objectives.

The migration to barrel exports (@/models and @/supporting) successfully implements the PR's goal to "export more types and add import aliases to enable external usage of common/shared types."


16-27: LGTM! Test logic preserved correctly.

The formatting changes maintain the original test coverage: proper validation of constructor type checks and successful instantiation with valid data.

test/unit/fissure.spec.ts (2)

5-5: LGTM! Standard chai expect pattern.

The declaration follows standard chai testing practices and supports the migration to expect-style assertions.


3-3: Import changes look good. The @/models path alias is properly configured in tsconfig.json, the migration to named exports is correct, and the type keyword for RawFissure follows TypeScript best practices. This aligns well with the PR's objective to enable external usage of common types.

test/unit/conclavechallenge.spec.ts (2)

8-8: LGTM! Assertion style migration completed correctly.

The migration from should-based assertions to expect-based assertions is implemented correctly throughout the test:

  • Error assertions properly use expect(() => { ... }).to.throw(TypeError)
  • Non-error assertions use expect(() => { ... }).to.not.throw()
  • Existence checks correctly use expect(...).to.exist

The assertion patterns are consistent and follow Chai best practices.

Also applies to: 13-18, 25-25, 28-30


3-6: Path aliases and JSON import assertions are properly configured and compatible.

The imports are correctly configured:

  • Path aliases are defined in tsconfig.json and resolve to the appropriate directories (@/models./lib/models/index, @/data/*test/data/*, etc.).
  • TypeScript version 5.9.3 supports JSON import assertions (requirement: 5.3+).
  • Node.js version 24.3.0 provides stable support for JSON import assertions (requirement: 20.10+).

The pattern is already established throughout the codebase with no configuration issues.

test/data/LanguageNews.json (1)

3-9: LGTM! Consistent test data format updates.

The changes correctly update date fields to MongoDB extended JSON format ($date with $numberLong) and normalize empty field representations. This aligns with the data format standardization across the test suite.

test/unit/flashsale.spec.ts (2)

3-3: LGTM! Clean migration to named exports and path aliases.

The import update correctly uses named exports from the centralized '@/models' alias, improving maintainability and aligning with the public API surface changes across the PR.


5-15: LGTM! Proper expect-style assertion migration.

The test assertions are correctly migrated from should-style to expect-style with proper error type checking (TypeError). The test semantics remain unchanged.

test/unit/event.spec.ts (2)

3-4: LGTM! Consistent import modernization.

The imports correctly use named exports from '@/models' and the proper TypeScript JSON import syntax with the type assertion. This aligns with the broader refactoring to centralize public API exports.


6-23: LGTM! Correct expect-style assertions.

All assertions are properly formed with parentheses (e.g., .to.not.throw()), correctly addressing the previous review comment. The test logic remains functionally equivalent.

test/unit/construction.spec.ts (2)

3-3: LGTM! Named export with specific path.

The import uses a specific path '@/models/ConstructionProgress' rather than the barrel export '@/models'. This is valid and may be intentional for direct imports.


5-31: LGTM! Comprehensive expect-style migration.

All assertions are correctly converted to expect-style, including error handling tests and property validation with regex patterns. The test coverage remains intact.

test/data/News.json (1)

3-9: LGTM! Consistent test data format updates.

The date fields are correctly updated to MongoDB extended JSON format, matching the standardization pattern applied across test data files (e.g., LanguageNews.json).

test/unit/syndicatemission.spec.ts (2)

3-3: LGTM! Consistent import migration.

The import correctly uses named exports from the '@/models' alias, aligning with the project-wide refactoring to expose public types through centralized barrel exports.


5-15: LGTM! Proper assertion style conversion.

The test assertions are correctly migrated to expect-style with appropriate TypeError validation. The test semantics are preserved.

test/unit/mission.spec.ts (2)

3-4: LGTM! Consistent import updates.

The imports correctly use named exports from '@/models' and proper JSON import syntax, aligning with the broader API surface refactoring.


6-24: LGTM! Proper expect-style assertions.

All test assertions are correctly converted to expect-style with appropriate error handling validation.

test/unit/darksector.spec.ts (1)

3-3: LGTM! Consistent import migration.

The import correctly uses named exports from the '@/models' alias, matching the pattern applied across all test files in this PR.

test/unit/reward.spec.ts (4)

5-5: LGTM! Import path updated to use centralized exports.

The import correctly uses the new path alias @/models and named exports, aligning with the PR's objective to centralize public API exports.


7-7: LGTM! Test style migration to expect.

The addition of const expect = chai.expect; supports the migration from should-style to expect-style assertions throughout the test suite.


13-18: LGTM! Assertion style updated consistently.

The migration from should-style to expect-style assertions (expect(...).to.throw(TypeError)) preserves the test behavior while standardizing on expect syntax.


39-42: LGTM! Test assertions migrated to expect style.

The assertions correctly use expect syntax while maintaining the original test logic for item type categorization and spy verification.

test/unit/syndicatejob.spec.ts (5)

3-3: LGTM! Import path updated to use centralized exports.

The import correctly uses the path alias @/models with named exports, consistent with the PR's public API centralization.


12-12: LGTM! Test style migration to expect.

The setup correctly adds const expect = chai.expect; to support expect-style assertions.


19-31: LGTM! Constructor test assertions updated to expect style.

The multi-line formatting improves readability, and the expect-style assertions correctly preserve the original test behavior for invalid constructor arguments.


40-41: LGTM! Reward pool assertions migrated to expect style.

The assertions correctly use expect syntax (expect(...).to.be.an('array'), expect(...).to.be.at.least(1)) while maintaining the original validation logic.


4-10: JSON import attributes syntax is fully supported in this project.

The project uses TypeScript 5.9.3 and Node.js 24.3.0, both well above the minimum requirements for the with { type: 'json' } syntax. The tsconfig.json is properly configured with module: "esnext", target: "es2024", and moduleResolution: "bundler" for modern module resolution.

test/unit/news.spec.ts (6)

3-6: LGTM! Imports updated to use centralized exports and path aliases.

The imports correctly use @/models for named exports and @/data for test fixtures with the modern JSON import attributes syntax, aligning with the PR's centralization objectives.


8-8: LGTM! Test style migration to expect.

The setup correctly adds const expect = chai.expect; to support the expect-style assertion migration.


15-20: LGTM! Constructor test assertions updated to expect style.

The expect-style assertions correctly preserve the original test behavior for invalid constructor arguments.


30-51: LGTM! ETA and update test assertions migrated to expect style.

The assertions correctly use expect syntax while maintaining the original test logic for ETA formatting, update detection, and stream detection.


58-105: LGTM! Link resolution test assertions updated to expect style.

The test correctly validates link resolution from the Links array when Prop is empty, and properly tests the default fallback behavior using expect-style assertions.


112-137: LGTM! Prime access and title test assertions migrated to expect style.

The assertions correctly use expect syntax while maintaining the original test logic for prime access detection and localized title retrieval.

lib/models/SentientOutpost.ts (3)

1-7: LGTM! Imports are correctly configured.

The type-only import for Dependency uses the path alias correctly, and the consolidated named imports from warframe-worldstate-data/utilities follow best practices.


30-34: LGTM! Interface is well-defined.

The renamed OutpostMission interface is clear and appropriately scoped with descriptive property names.


68-94: Clarify active field semantics and the unused sat().active value.

The JSDoc states active captures "whether or not the object was active during creation" (snapshot semantics). However, sat() computes a temporal active value (30m active window in 3-hour cycle) that is never used. Additionally, when sentientData overrides activation/expiry (lines 87-92), active is not recalculated, making the embedded value in id stale. Confirm whether:

  • The snapshot behavior is intentional (supporting the current code), or
  • Temporal activity should drive active (requiring recalculation after sentientData override and using sat().active).

@TobiTenno TobiTenno force-pushed the aliases-exports-oh-my branch from fed0c07 to d199d7c Compare December 29, 2025 21:26
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
lib/models/Reward.ts (1)

82-88: Consider caching getTypesFull() result to avoid redundant computation.

getTypesFull() is called 4 times here, each performing array concatenation and mapping. Caching the result would improve performance, especially with larger reward lists.

🔎 Proposed fix
-    this.thumbnail = this.getTypesFull()[0]
-      ? this.getTypesFull()[0].thumbnail
-      : 'https://i.imgur.com/JCKyUXJ.png';
-
-    this.color = this.getTypesFull()[0]
-      ? this.getTypesFull()[0].color
-      : 0xf1c40f;
+    const firstType = this.getTypesFull()[0];
+    this.thumbnail = firstType?.thumbnail ?? 'https://i.imgur.com/JCKyUXJ.png';
+    this.color = firstType?.color ?? 0xf1c40f;
lib/models/Fissure.ts (1)

117-119: Consider removing redundant activation/expiry assignments.

The parent class WorldStateObject already initializes activation and expiry in its constructor via the super(data) call on line 92. These assignments duplicate that behavior.

Since RawFissure defines Activation and Expiry as required fields, the parent's conditional logic will always execute for Fissure instances, making these assignments redundant.

🔎 Proposed refactor to remove duplicate assignments
    this.tierNum = fissureTier(data.Modifier || data.ActiveMissionTier, locale);

-    this.activation = parseDate(data.Activation);
-
-    this.expiry = parseDate(data.Expiry);
-
    this.isStorm = Boolean(data.ActiveMissionTier);

    this.isHard = Boolean(data.Hard);
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 13b1510 and d199d7c.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (16)
  • lib/models/ChallengeInstance.ts
  • lib/models/ConclaveChallenge.ts
  • lib/models/DailyDeal.ts
  • lib/models/Fissure.ts
  • lib/models/GlobalUpgrade.ts
  • lib/models/Mission.ts
  • lib/models/Reward.ts
  • lib/models/SentientOutpost.ts
  • lib/models/Simaris.ts
  • lib/models/Sortie.ts
  • lib/models/SortieVariant.ts
  • lib/models/Tmp.ts
  • lib/models/VoidTraderSchedule.ts
  • package.json
  • test/unit/archimedea.spec.ts
  • test/unit/mission.spec.ts
🚧 Files skipped from review as they are similar to previous changes (5)
  • lib/models/ChallengeInstance.ts
  • test/unit/mission.spec.ts
  • package.json
  • test/unit/archimedea.spec.ts
  • lib/models/Tmp.ts
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-16T02:24:30.860Z
Learnt from: SlayerOrnstein
Repo: WFCD/warframe-worldstate-parser PR: 702
File: lib/models/Archidemea.ts:74-90
Timestamp: 2025-10-16T02:24:30.860Z
Learning: In Warframe's Archimedea/Conquest data structure (lib/models/Archidemea.ts), Digital Extremes duplicates difficulties when adding hard tier risks. The first risk in higher difficulties (e.g., CD_HARD) is always identical to the one in the normal difficulty (CD_NORMAL), so using `slice(1)` to skip the first risk when processing additional difficulties is the correct approach to avoid duplicates.

Applied to files:

  • lib/models/Mission.ts
  • lib/models/SortieVariant.ts
🧬 Code graph analysis (9)
lib/models/ConclaveChallenge.ts (2)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/models/DailyDeal.ts (2)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/models/Mission.ts (2)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/models/Reward.ts (1)
  • Reward (31-108)
lib/models/SortieVariant.ts (1)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/models/Reward.ts (2)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/supporting/RewardTypes.ts (1)
  • RewardType (8-33)
lib/models/SentientOutpost.ts (1)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/models/GlobalUpgrade.ts (2)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/models/Sortie.ts (3)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
lib/models/SortieVariant.ts (1)
  • SortieVariant (21-76)
lib/models/Fissure.ts (2)
lib/models/WorldStateObject.ts (1)
  • WorldStateObject (23-79)
lib/supporting/Dependency.ts (1)
  • Dependency (9-39)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Test (20)
  • GitHub Check: Coverage
🔇 Additional comments (39)
lib/models/VoidTraderSchedule.ts (1)

1-20: LGTM! Clean refactoring aligns with PR objectives.

The changes successfully convert to named exports and improve import organization:

  • Type-only import for ContentTimestamp follows best practices
  • Dependency imported from the @/supporting barrel export (previous concerns addressed)
  • Named export enables external usage as intended by the PR

The implementation is correct and consistent with the architectural changes across the codebase.

lib/models/DailyDeal.ts (4)

10-10: LGTM!

The named import of WorldStateObject is correct and aligns with the refactoring to named exports.


72-75: LGTM!

The constructor formatting has been improved for readability with no semantic changes to the parameters or default values.


26-26: [rewritten comment]
[classification tag]


8-8: The path alias configuration is properly set up in tsconfig.json. The @/supporting alias is correctly mapped to ./lib/supporting/index, so this import will resolve correctly.

lib/models/Simaris.ts (3)

1-48: LGTM! Changes align with PR objectives.

The conversion from default export to named export and the use of path aliases for imports successfully achieves the PR's goal of enabling external usage of common/shared types. The functionality of the Simaris class remains intact.


3-3: Path alias and barrel export are correctly configured.

The @/supporting alias is properly defined in tsconfig.json, and lib/supporting/index.ts correctly exports the Dependency type via barrel export from lib/supporting/Dependency.ts.


13-13: No action required: breaking change is properly handled.

The export change from default to named export has been correctly implemented throughout the codebase. All internal consumers—including tests and WorldState.ts—have been updated to use the named import pattern import { Simaris } from '@/models', and the barrel export correctly re-exports the named export via export * from './Simaris'.

lib/models/SortieVariant.ts (2)

1-21: LGTM - Clean refactoring to named exports and path aliases.

The import reorganization, switch from default to named export, and path alias usage (@/supporting) are consistent with the PR's goal of enabling external usage of shared types. The class logic remains unchanged.


58-61: Constructor formatting update looks good.

The multi-line parameter formatting improves readability while maintaining the same default behavior ({ locale: 'en' }).

lib/models/Sortie.ts (3)

10-15: Import refactoring aligns with the PR objectives.

The switch to path aliases (@/supporting), type-only imports, and named imports from local modules is consistent with the goal of enabling external usage of shared types. The separation of type imports (using type keyword) from value imports is a good TypeScript practice.


26-30: Class declaration and JSDoc are correctly updated.

The @augments {WorldStateObject} annotation and named export pattern are consistent with the broader refactoring.


66-84: Constructor and variants mapping refactored correctly.

The multi-line formatting improves readability. The opts object correctly passes sortieData and locale to SortieVariant constructor, maintaining the existing behavior.

lib/models/Reward.ts (2)

1-4: Import refactoring to path aliases looks good.

The switch to @/supporting for Dependency and RewardTypes aligns with the PR's objective of enabling external usage of shared types.


31-31: Named export is consistent with the broader refactoring.

lib/models/Mission.ts (4)

1-11: Import refactoring is clean and well-organized.

The multi-line import from warframe-worldstate-data/utilities, path alias for Dependency, and type-only import for RawReward follow the established pattern in this PR.


41-41: Named export is appropriate.

The class is now exported as a named export, consistent with the broader refactoring pattern. The previously flagged naming conflict with Mission interface in SentientOutpost.ts has been addressed.


166-189: Constructor formatting and reward handling look good.

The multi-line signature and conditional Reward instantiation maintain existing behavior with improved readability.


207-227: Array mapping reformats are clean.

The multi-line formatting for advancedSpawners, requiredItems, target, and levelAuras improves readability while maintaining the same null-safe mapping logic with languageString.

lib/models/GlobalUpgrade.ts (4)

1-8: LGTM! Import additions are correct.

The addition of upgrade to the imports from warframe-worldstate-data/utilities is properly utilized on line 57.


10-10: LGTM! Import path correctly uses the alias.

The Dependency import now correctly uses the @/supporting path alias, consistent with the broader refactor. The previous issue with the malformed path has been addressed.


12-12: LGTM! WorldStateObject imports are correct.

The import correctly uses named imports for both WorldStateObject (with capital S) and BaseContentObject, consistent with the codebase-wide rename and refactor.


25-25: All imports properly updated to use named exports.

The switch from default export to named export is consistent across the codebase. Verification confirms no remaining default imports, and all references (including test files and WorldState.ts) correctly use the named import syntax via the barrel export at lib/models/index.ts.

lib/models/ConclaveChallenge.ts (4)

26-28: LGTM! Consistent rename to WorldStateObject.

The JSDoc and class declaration have been correctly updated to reflect the WorldStateObject rename, maintaining consistency across the codebase.


79-82: LGTM! Improved type safety with explicit annotations.

The constructor signature now includes explicit type annotations and properly handles default values for the dependency parameter. The dual default pattern (destructuring default + parameter default) ensures robust behavior.


103-107: LGTM! Improved destructuring readability.

The multi-line destructuring assignment improves code readability while maintaining the same functionality.


11-13: Import path fix is correct and properly configured.

The @/supporting path alias correctly resolves to lib/supporting/index.ts, which re-exports the Dependency type. The tsconfig path mappings are properly configured, and the import statement will resolve as expected.

lib/models/SentientOutpost.ts (6)

1-7: LGTM! Type-only import is a best practice.

The import statements are well-structured. The type-only import for Dependency is appropriate since it's exclusively used for type annotations in the constructor parameter, which can improve build times and avoid potential circular dependency issues.


30-34: LGTM! Clearer interface naming.

Renaming Mission to OutpostMission improves clarity and reduces naming conflicts, especially now that it's part of the exported public API.


40-41: LGTM! Good use of readonly modifier.

Converting to a named export aligns with the PR's goal of standardizing exports. The readonly modifier on node is excellent defensive programming since the field is initialized once in the constructor and never modified thereafter.


48-62: LGTM! Explicit field declarations improve type safety.

Making these field declarations explicit (rather than relying on implicit inference) improves type safety, IDE autocomplete support, and code readability. All field types correctly match their constructor assignments.


68-71: LGTM! Improved readability.

The multiline constructor parameter formatting enhances readability without affecting functionality.


30-34: All consumers have been successfully updated for the breaking changes. The named import of SentientOutpost is correctly used in test/unit/sentientOutpost.spec.ts and lib/models/Tmp.ts, with no remaining default imports. The interface rename from Mission to OutpostMission is properly applied at line 30 and correctly referenced at line 57. The re-export in lib/models/index.ts is configured correctly.

lib/models/Fissure.ts (6)

30-32: LGTM!

The conversion from default to named export and the base class name correction (WorldStateObject with capital S) align well with the PR objectives to enable external usage of shared types.


88-91: LGTM!

The constructor signature is properly typed with the Dependency interface, and the default value { locale: 'en' } ensures the required locale field is always available.


121-123: LGTM!

The boolean flag initializations correctly use Boolean() conversion and properly handle both required (ActiveMissionTier) and optional (Hard) fields from the raw data.


96-98: LGTM!

The multi-line formatting of these expressions improves readability while preserving the original logic.

Also applies to: 100-102, 110-113


14-14: The TypeScript path alias @/supporting is properly configured in tsconfig.json and resolves to ./lib/supporting/index, which correctly exports the Dependency type. The import is valid.


129-138: No changes needed—non-null assertions are correctly justified by the type contract.

The expired and eta getters safely use non-null assertions because:

  1. RawFissure interface explicitly defines Expiry as a required field (not optional)
  2. The Fissure constructor parameter is typed as RawFissure, enforcing this contract at compile time
  3. The constructor unconditionally assigns this.expiry = parseDate(data.Expiry), guaranteeing the property is set
  4. This pattern is consistent with other models like VoidTrader that also have required expiry fields and use non-null assertions

The parent class WorldStateObject uses defensive checks because it accepts the generic BaseContentObject interface where Expiry is optional. Fissure is more specific: it requires Expiry in its input data, so the assertions match the actual data contract. Adding defensive checks would contradict the type system and require changing return types from string/boolean to string | undefined/boolean | undefined, breaking the API.

Likely an incorrect or invalid review comment.

@TobiTenno TobiTenno merged commit d99ff9c into master Dec 30, 2025
15 of 18 checks passed
@TobiTenno TobiTenno deleted the aliases-exports-oh-my branch December 30, 2025 14:55
@github-actions
Copy link

🎉 This PR is included in version 5.2.14 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants