diff options
| author | Bobby <[email protected]> | 2026-04-22 07:39:20 +0530 |
|---|---|---|
| committer | Bobby <[email protected]> | 2026-04-22 07:39:20 +0530 |
| commit | 22912c4af19b9055ed95779c4d16020fe3a449eb (patch) | |
| tree | 9d2391df4cf27eb95b198685fbb33df2a1c42991 | |
| parent | 9f807f7e2d2d3711e2ca90cb3984234eef832ad4 (diff) | |
| download | hollowdark-22912c4af19b9055ed95779c4d16020fe3a449eb.tar.xz hollowdark-22912c4af19b9055ed95779c4d16020fe3a449eb.zip | |
Drop all barrel index.ts files; imports target leaf files directly
40 files changed, 57 insertions, 267 deletions
diff --git a/engine/career/career.ts b/engine/career/career.ts index a052ae6..aa19584 100644 --- a/engine/career/career.ts +++ b/engine/career/career.ts @@ -1,4 +1,4 @@ -import type { GameTime } from '@hollowdark/time' +import type { GameTime } from '@hollowdark/time/gameTime' import type { InstitutionId } from '../entities/base' export type CareerTrajectory = 'rising' | 'steady' | 'declining' | 'stalled' diff --git a/engine/career/index.ts b/engine/career/index.ts deleted file mode 100644 index 48daad7..0000000 --- a/engine/career/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -export type { - CareerHistoryEntry, - CareerPerformance, - CareerState, - CareerTrajectory -} from './career' diff --git a/engine/economics/index.ts b/engine/economics/index.ts deleted file mode 100644 index 511c42b..0000000 --- a/engine/economics/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -export type { - Account, - AccountKind, - Asset, - AssetKind, - Debt, - DebtKind, - EconomicClass, - EconomicState -} from './economic' - -export type { AffordabilityContext, Feasibility, PossiblePurchase } from './affordability' diff --git a/engine/entities/base.ts b/engine/entities/base.ts index 14afd22..84b9acf 100644 --- a/engine/entities/base.ts +++ b/engine/entities/base.ts @@ -1,5 +1,5 @@ -import type { GameTime } from '@hollowdark/time' -import type { Brand } from '@hollowdark/utils' +import type { GameTime } from '@hollowdark/time/gameTime' +import type { Brand } from '@hollowdark/utils/types/brand' /** * Branded IDs — string at runtime, distinct at compile time so a PersonId diff --git a/engine/entities/event-log-entry.ts b/engine/entities/event-log-entry.ts index 6018e3c..f31536d 100644 --- a/engine/entities/event-log-entry.ts +++ b/engine/entities/event-log-entry.ts @@ -1,4 +1,4 @@ -import type { GameTime } from '@hollowdark/time' +import type { GameTime } from '@hollowdark/time/gameTime' import type { EventLogEntryId, PersonId } from './base' /** diff --git a/engine/entities/flow-entry.ts b/engine/entities/flow-entry.ts index 4461aa7..bd781d5 100644 --- a/engine/entities/flow-entry.ts +++ b/engine/entities/flow-entry.ts @@ -1,4 +1,4 @@ -import type { GameTime } from '@hollowdark/time' +import type { GameTime } from '@hollowdark/time/gameTime' import type { FlowEntryId, PersonId, PlaceId, WorldEventId } from './base' /** diff --git a/engine/entities/index.ts b/engine/entities/index.ts deleted file mode 100644 index 9b520ac..0000000 --- a/engine/entities/index.ts +++ /dev/null @@ -1,67 +0,0 @@ -export type { - BaseEntity, - EntityKind, - EventLogEntryId, - FlowEntryId, - InstitutionId, - MemoirId, - PersonId, - PlaceId, - RelationshipId, - RoutineId, - ScheduledEventId, - WorldEventId, - WorldId -} from './base' - -export type { AppliedConsequence, EventLogEntry } from './event-log-entry' -export type { FlowContextSnapshot, FlowEntry } from './flow-entry' -export type { Institution, InstitutionEvent, InstitutionType } from './institution' -export type { Memoir, MemoirChapter } from './memoir' -export type { - BirthRecord, - DeathMode, - DeathRecord, - Person, - SimulationTier -} from './person' -export type { PersonName } from './person-name' -export type { - ClimateDescriptor, - CultureDescriptor, - EconomicCharacter, - Place, - PlaceType, - PoliticalCharacter -} from './place' -export type { - ConflictEvent, - FamilyRelation, - InfidelityEvent, - IntimacyAxes, - LoveLanguageMatrix, - LoveLanguageProfile, - Relationship, - RelationshipPerception, - RelationshipState, - RelationType, - RomanticPhase, - SexualActivityState, - SharedExperience, - Tension, - TrustEvent, - WorkRelation -} from './relationship' -export type { ReputationProfile } from './reputation' -export type { ResidenceEntry } from './residence' -export type { Routine, RoutineCategory, RoutineEffect, RoutineItem } from './routine' -export type { ConditionalTrigger, ScheduledEvent } from './scheduled-event' -export type { SocioeconomicTier, StatusDescriptor } from './status' -export type { - CrisisState, - MacroEconomicState, - RegionPoliticalState, - World, - WorldSettings -} from './world' -export type { EventCategory, SeverityLevel, WorldEvent } from './world-event' diff --git a/engine/entities/institution.ts b/engine/entities/institution.ts index ebf571c..4b3c050 100644 --- a/engine/entities/institution.ts +++ b/engine/entities/institution.ts @@ -1,4 +1,4 @@ -import type { GameTime } from '@hollowdark/time' +import type { GameTime } from '@hollowdark/time/gameTime' import type { BaseEntity, InstitutionId, PersonId, PlaceId } from './base' import type { CultureDescriptor } from './place' diff --git a/engine/entities/memoir.ts b/engine/entities/memoir.ts index 33ddfc3..c0f44f3 100644 --- a/engine/entities/memoir.ts +++ b/engine/entities/memoir.ts @@ -1,4 +1,4 @@ -import type { GameTime } from '@hollowdark/time' +import type { GameTime } from '@hollowdark/time/gameTime' import type { EventLogEntryId, MemoirId, PersonId } from './base' export interface MemoirChapter { diff --git a/engine/entities/person.ts b/engine/entities/person.ts index 89b2b11..beabede 100644 --- a/engine/entities/person.ts +++ b/engine/entities/person.ts @@ -1,16 +1,18 @@ -import type { GameTime } from '@hollowdark/time' -import type { CareerState } from '../career' -import type { EconomicState } from '../economics' -import type { HealthState, MentalHealthState, Condition } from '../health' -import type { Dependency, MoodState, SatisfactionProfile, Scar } from '../state' -import type { - AttachmentDistribution, - BigFiveProfile, - CoreBeliefs, - DarkTriadProfile, - SexualOrientation, - ValuesOrientation -} from '../traits' +import type { GameTime } from '@hollowdark/time/gameTime' +import type { CareerState } from '../career/career' +import type { EconomicState } from '../economics/economic' +import type { Condition, HealthState } from '../health/health' +import type { MentalHealthState } from '../health/mental-health' +import type { Dependency } from '../state/dependency' +import type { MoodState } from '../state/mood' +import type { SatisfactionProfile } from '../state/satisfaction' +import type { Scar } from '../state/scar' +import type { AttachmentDistribution } from '../traits/attachment' +import type { BigFiveProfile } from '../traits/big-five' +import type { CoreBeliefs } from '../traits/core-beliefs' +import type { DarkTriadProfile } from '../traits/dark-triad' +import type { SexualOrientation } from '../traits/orientation' +import type { ValuesOrientation } from '../traits/values' import type { BaseEntity, PersonId, PlaceId, RelationshipId } from './base' import type { EventLogEntry } from './event-log-entry' import type { PersonName } from './person-name' diff --git a/engine/entities/relationship.ts b/engine/entities/relationship.ts index 92e9cd5..ec00007 100644 --- a/engine/entities/relationship.ts +++ b/engine/entities/relationship.ts @@ -1,4 +1,4 @@ -import type { GameTime } from '@hollowdark/time' +import type { GameTime } from '@hollowdark/time/gameTime' import type { BaseEntity, PersonId, RelationshipId } from './base' export type RelationType = diff --git a/engine/entities/residence.ts b/engine/entities/residence.ts index 78ae71a..a052c42 100644 --- a/engine/entities/residence.ts +++ b/engine/entities/residence.ts @@ -1,4 +1,4 @@ -import type { GameTime } from '@hollowdark/time' +import type { GameTime } from '@hollowdark/time/gameTime' import type { PlaceId } from './base' /** A span of time a character lived at a specific place. Open-ended if the diff --git a/engine/entities/routine.ts b/engine/entities/routine.ts index d4af331..251cbde 100644 --- a/engine/entities/routine.ts +++ b/engine/entities/routine.ts @@ -1,4 +1,4 @@ -import type { GameTime } from '@hollowdark/time' +import type { GameTime } from '@hollowdark/time/gameTime' import type { PersonId, RoutineId } from './base' export type RoutineCategory = 'work' | 'relationships' | 'self' | 'home' | 'play' | 'service' diff --git a/engine/entities/scheduled-event.ts b/engine/entities/scheduled-event.ts index 6bb9fa8..08be670 100644 --- a/engine/entities/scheduled-event.ts +++ b/engine/entities/scheduled-event.ts @@ -1,4 +1,4 @@ -import type { GameTime } from '@hollowdark/time' +import type { GameTime } from '@hollowdark/time/gameTime' import type { PersonId, ScheduledEventId } from './base' /** diff --git a/engine/entities/world-event.ts b/engine/entities/world-event.ts index 266262a..8b4e2a6 100644 --- a/engine/entities/world-event.ts +++ b/engine/entities/world-event.ts @@ -1,4 +1,4 @@ -import type { GameTime } from '@hollowdark/time' +import type { GameTime } from '@hollowdark/time/gameTime' import type { BaseEntity, PersonId, PlaceId, WorldEventId } from './base' export type EventCategory = diff --git a/engine/entities/world.ts b/engine/entities/world.ts index 45cb401..920fe05 100644 --- a/engine/entities/world.ts +++ b/engine/entities/world.ts @@ -1,4 +1,4 @@ -import type { GameTime } from '@hollowdark/time' +import type { GameTime } from '@hollowdark/time/gameTime' import type { PersonId, PlaceId, WorldEventId, WorldId } from './base' import type { ScheduledEvent } from './scheduled-event' diff --git a/engine/health/health.ts b/engine/health/health.ts index fdcfd3d..e08433d 100644 --- a/engine/health/health.ts +++ b/engine/health/health.ts @@ -1,4 +1,4 @@ -import type { GameTime } from '@hollowdark/time' +import type { GameTime } from '@hollowdark/time/gameTime' export type EatingPattern = 'poor' | 'irregular' | 'moderate' | 'good' | 'athletic' diff --git a/engine/health/index.ts b/engine/health/index.ts deleted file mode 100644 index 0577d7a..0000000 --- a/engine/health/index.ts +++ /dev/null @@ -1,20 +0,0 @@ -export type { - Condition, - EatingPattern, - HealthState, - LifestyleProfile, - MedicalEvent, - SexualHealthState, - Symptom, - UndiagnosedCondition -} from './health' - -export type { - CopingStrategy, - HistoricalCondition, - Medication, - MentalCondition, - MentalHealthState, - SuicidalRisk, - TraumaPattern -} from './mental-health' diff --git a/engine/health/mental-health.ts b/engine/health/mental-health.ts index 5cd017a..7130177 100644 --- a/engine/health/mental-health.ts +++ b/engine/health/mental-health.ts @@ -1,4 +1,4 @@ -import type { GameTime } from '@hollowdark/time' +import type { GameTime } from '@hollowdark/time/gameTime' /** Currently-active mental-health condition. Specific disorder vocabulary * lives in content; the runtime state is shape + kind tag. */ diff --git a/engine/index.ts b/engine/index.ts deleted file mode 100644 index d3a11cb..0000000 --- a/engine/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -export * from './career' -export * from './economics' -export * from './entities' -export * from './health' -export * from './state' -export * from './traits' diff --git a/engine/state/dependency.ts b/engine/state/dependency.ts index 3af9e08..47787da 100644 --- a/engine/state/dependency.ts +++ b/engine/state/dependency.ts @@ -1,4 +1,4 @@ -import type { GameTime } from '@hollowdark/time' +import type { GameTime } from '@hollowdark/time/gameTime' /** * A substance or behavioural dependency at a given stage of progression. diff --git a/engine/state/index.ts b/engine/state/index.ts deleted file mode 100644 index 1641d3b..0000000 --- a/engine/state/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export type { Dependency, DependencyStage } from './dependency' -export type { MoodState } from './mood' -export type { SatisfactionProfile } from './satisfaction' -export type { Scar } from './scar' diff --git a/engine/state/mood.ts b/engine/state/mood.ts index a2420b6..501a699 100644 --- a/engine/state/mood.ts +++ b/engine/state/mood.ts @@ -1,4 +1,4 @@ -import type { GameTime } from '@hollowdark/time' +import type { GameTime } from '@hollowdark/time/gameTime' /** * Current-week emotional state on the valence × arousal plane. diff --git a/engine/state/scar.ts b/engine/state/scar.ts index 6de9d4f..5f9fc30 100644 --- a/engine/state/scar.ts +++ b/engine/state/scar.ts @@ -1,4 +1,4 @@ -import type { GameTime } from '@hollowdark/time' +import type { GameTime } from '@hollowdark/time/gameTime' /** * A lasting mark left by a high-weight event. Scars don't decay the way diff --git a/engine/traits/index.ts b/engine/traits/index.ts deleted file mode 100644 index c743af8..0000000 --- a/engine/traits/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -export type { AttachmentDistribution } from './attachment' -export type { BigFiveProfile } from './big-five' -export type { CoreBeliefs } from './core-beliefs' -export type { DarkTriadProfile } from './dark-triad' -export type { Gender, SexualOrientation } from './orientation' -export type { ValuesOrientation } from './values' diff --git a/persistence/db.ts b/persistence/db.ts index c0bbf5d..213e19b 100644 --- a/persistence/db.ts +++ b/persistence/db.ts @@ -1,19 +1,17 @@ import Dexie, { type Table } from 'dexie' -import type { - EventLogEntry, - FlowEntry, - Institution, - Memoir, - Person, - Place, - Relationship, - Routine, - ScheduledEvent, - World, - WorldEvent -} from '@hollowdark/engine' -import type { JsonValue } from '@hollowdark/utils' +import type { EventLogEntry } from '@hollowdark/engine/entities/event-log-entry' +import type { FlowEntry } from '@hollowdark/engine/entities/flow-entry' +import type { Institution } from '@hollowdark/engine/entities/institution' +import type { Memoir } from '@hollowdark/engine/entities/memoir' +import type { Person } from '@hollowdark/engine/entities/person' +import type { Place } from '@hollowdark/engine/entities/place' +import type { Relationship } from '@hollowdark/engine/entities/relationship' +import type { Routine } from '@hollowdark/engine/entities/routine' +import type { ScheduledEvent } from '@hollowdark/engine/entities/scheduled-event' +import type { World } from '@hollowdark/engine/entities/world' +import type { WorldEvent } from '@hollowdark/engine/entities/world-event' +import type { JsonValue } from '@hollowdark/utils/types/json' import { AUDIO_CACHE_DB_NAME, diff --git a/persistence/index.ts b/persistence/index.ts deleted file mode 100644 index f809246..0000000 --- a/persistence/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -export { - HollowdarkAudioCache, - HollowdarkContentCache, - HollowdarkUserData, - type CachedAudioTrack, - type CachedContentChunk, - type CachedManifest, - type Setting -} from './db' - -export { - AUDIO_CACHE_DB_NAME, - AUDIO_CACHE_SCHEMA_V1, - CONTENT_CACHE_DB_NAME, - CONTENT_CACHE_SCHEMA_V1, - SCHEMA_VERSION, - USER_DATA_DB_NAME, - USER_DATA_SCHEMA_V1 -} from './schema' diff --git a/rng/index.ts b/rng/index.ts deleted file mode 100644 index b01e0dd..0000000 --- a/rng/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { createRNG, type SeededRNG } from './seeded' -export { hashString, deriveSeed } from './derive' diff --git a/tests/determinism/rng.test.ts b/tests/determinism/rng.test.ts index 91e720b..57a1e10 100644 --- a/tests/determinism/rng.test.ts +++ b/tests/determinism/rng.test.ts @@ -1,5 +1,6 @@ import { describe, expect, test } from 'vitest' -import { createRNG, deriveSeed, hashString } from '@hollowdark/rng' +import { deriveSeed, hashString } from '@hollowdark/rng/derive' +import { createRNG } from '@hollowdark/rng/seeded' describe('hashString', () => { test('is deterministic', () => { diff --git a/tests/unit/persistence/schema.test.ts b/tests/unit/persistence/schema.test.ts index a02802b..51a22ad 100644 --- a/tests/unit/persistence/schema.test.ts +++ b/tests/unit/persistence/schema.test.ts @@ -7,7 +7,7 @@ import { SCHEMA_VERSION, USER_DATA_DB_NAME, USER_DATA_SCHEMA_V1 -} from '@hollowdark/persistence' +} from '@hollowdark/persistence/schema' /** * The Dexie schema is a versioned contract with on-device storage. Any diff --git a/tests/unit/utils/assert.test.ts b/tests/unit/utils/assert.test.ts index d0dbae6..ab660dc 100644 --- a/tests/unit/utils/assert.test.ts +++ b/tests/unit/utils/assert.test.ts @@ -1,5 +1,7 @@ import { describe, expect, test } from 'vitest' -import { assert, assertDefined, assertNever } from '@hollowdark/utils/assert' +import { assert } from '@hollowdark/utils/assert/assert' +import { assertDefined } from '@hollowdark/utils/assert/assert-defined' +import { assertNever } from '@hollowdark/utils/assert/assert-never' describe('assert', () => { test('passes on truthy condition', () => { diff --git a/tests/unit/utils/equal.test.ts b/tests/unit/utils/equal.test.ts index 760262e..c1ea228 100644 --- a/tests/unit/utils/equal.test.ts +++ b/tests/unit/utils/equal.test.ts @@ -1,5 +1,5 @@ import { describe, expect, test } from 'vitest' -import { deepEqual } from '@hollowdark/utils/equal' +import { deepEqual } from '@hollowdark/utils/equal/deep' describe('deepEqual — primitives', () => { test('identical primitives', () => { diff --git a/tests/unit/utils/result.test.ts b/tests/unit/utils/result.test.ts index abfcac9..bdd4923 100644 --- a/tests/unit/utils/result.test.ts +++ b/tests/unit/utils/result.test.ts @@ -1,15 +1,9 @@ import { describe, expect, test } from 'vitest' -import { - err, - isErr, - isOk, - mapErr, - mapResult, - ok, - unwrap, - unwrapOr, - type Result -} from '@hollowdark/utils/result' +import { err, ok } from '@hollowdark/utils/result/constructors' +import { mapErr, mapResult } from '@hollowdark/utils/result/map' +import { isErr, isOk } from '@hollowdark/utils/result/predicates' +import type { Result } from '@hollowdark/utils/result/types' +import { unwrap, unwrapOr } from '@hollowdark/utils/result/unwrap' describe('Result constructors and predicates', () => { test('ok wraps a value', () => { diff --git a/time/index.ts b/time/index.ts deleted file mode 100644 index e111b0d..0000000 --- a/time/index.ts +++ /dev/null @@ -1,45 +0,0 @@ -export { - DAYS_PER_MONTH, - DAYS_PER_WEEK, - DAYS_PER_YEAR, - FESTIVAL_DAYS, - FESTIVAL_MONTH, - MONTHS_PER_YEAR, - MONTH_NAMES, - REGULAR_MONTH_COUNT, - daysInMonth, - isFestival, - monthName, - monthSeason, - type MonthName, - type Season -} from './calendar' - -export { - addDays, - addMonths, - addWeeks, - addYears, - compareGameTime, - dayOfWeek, - dayOfYear, - daysBetween, - formatGameTime, - isAfter, - isBefore, - isSameDay, - makeGameTime, - toAbsoluteDays, - weeksBetween, - type GameTime -} from './gameTime' - -export { - TICK_UNIT_BY_LIFE_STAGE, - lifeStageForAge, - tickUnitForAge, - type LifeStage, - type TickUnit -} from './granularity' - -export { SPEEDS, type Speed } from './speed' diff --git a/utils/assert/index.ts b/utils/assert/index.ts deleted file mode 100644 index a3df835..0000000 --- a/utils/assert/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { assert } from './assert' -export { assertDefined } from './assert-defined' -export { assertNever } from './assert-never' diff --git a/utils/equal/index.ts b/utils/equal/index.ts deleted file mode 100644 index 3a937a8..0000000 --- a/utils/equal/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { deepEqual } from './deep' diff --git a/utils/index.ts b/utils/index.ts deleted file mode 100644 index 436365f..0000000 --- a/utils/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './assert' -export * from './equal' -export * from './log' -export * from './result' -export * from './types' diff --git a/utils/log/index.ts b/utils/log/index.ts deleted file mode 100644 index 62d96a1..0000000 --- a/utils/log/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { log } from './log' diff --git a/utils/result/index.ts b/utils/result/index.ts deleted file mode 100644 index 931b638..0000000 --- a/utils/result/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export type { Err, Ok, Result } from './types' -export { err, ok } from './constructors' -export { isErr, isOk } from './predicates' -export { mapErr, mapResult } from './map' -export { unwrap, unwrapOr } from './unwrap' diff --git a/utils/types/index.ts b/utils/types/index.ts deleted file mode 100644 index cf55ea7..0000000 --- a/utils/types/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export type { Brand } from './brand' -export type { DeepReadonly } from './deep-readonly' -export type { ElementOf } from './element-of' -export type { JsonValue } from './json' -export type { NonEmptyArray } from './non-empty-array' |
