diff options
28 files changed, 32 insertions, 47 deletions
diff --git a/engine/career/career.ts b/engine/career/career.ts index b235f6e..a052ae6 100644 --- a/engine/career/career.ts +++ b/engine/career/career.ts @@ -1,4 +1,4 @@ -import type { GameTime } from 'time' +import type { GameTime } from '@hollowdark/time' import type { InstitutionId } from '../entities/base' export type CareerTrajectory = 'rising' | 'steady' | 'declining' | 'stalled' diff --git a/engine/entities/base.ts b/engine/entities/base.ts index cc7c9ed..14afd22 100644 --- a/engine/entities/base.ts +++ b/engine/entities/base.ts @@ -1,5 +1,5 @@ -import type { GameTime } from 'time' -import type { Brand } from 'utils' +import type { GameTime } from '@hollowdark/time' +import type { Brand } from '@hollowdark/utils' /** * 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 ba0b6e2..6018e3c 100644 --- a/engine/entities/event-log-entry.ts +++ b/engine/entities/event-log-entry.ts @@ -1,4 +1,4 @@ -import type { GameTime } from 'time' +import type { GameTime } from '@hollowdark/time' import type { EventLogEntryId, PersonId } from './base' /** diff --git a/engine/entities/flow-entry.ts b/engine/entities/flow-entry.ts index ff2e624..4461aa7 100644 --- a/engine/entities/flow-entry.ts +++ b/engine/entities/flow-entry.ts @@ -1,4 +1,4 @@ -import type { GameTime } from 'time' +import type { GameTime } from '@hollowdark/time' import type { FlowEntryId, PersonId, PlaceId, WorldEventId } from './base' /** diff --git a/engine/entities/institution.ts b/engine/entities/institution.ts index 2bb582d..ebf571c 100644 --- a/engine/entities/institution.ts +++ b/engine/entities/institution.ts @@ -1,4 +1,4 @@ -import type { GameTime } from 'time' +import type { GameTime } from '@hollowdark/time' 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 c6dcf57..33ddfc3 100644 --- a/engine/entities/memoir.ts +++ b/engine/entities/memoir.ts @@ -1,4 +1,4 @@ -import type { GameTime } from 'time' +import type { GameTime } from '@hollowdark/time' import type { EventLogEntryId, MemoirId, PersonId } from './base' export interface MemoirChapter { diff --git a/engine/entities/person.ts b/engine/entities/person.ts index db86c47..89b2b11 100644 --- a/engine/entities/person.ts +++ b/engine/entities/person.ts @@ -1,4 +1,4 @@ -import type { GameTime } from 'time' +import type { GameTime } from '@hollowdark/time' import type { CareerState } from '../career' import type { EconomicState } from '../economics' import type { HealthState, MentalHealthState, Condition } from '../health' diff --git a/engine/entities/relationship.ts b/engine/entities/relationship.ts index c6a771c..92e9cd5 100644 --- a/engine/entities/relationship.ts +++ b/engine/entities/relationship.ts @@ -1,4 +1,4 @@ -import type { GameTime } from 'time' +import type { GameTime } from '@hollowdark/time' import type { BaseEntity, PersonId, RelationshipId } from './base' export type RelationType = diff --git a/engine/entities/residence.ts b/engine/entities/residence.ts index 6a404f7..78ae71a 100644 --- a/engine/entities/residence.ts +++ b/engine/entities/residence.ts @@ -1,4 +1,4 @@ -import type { GameTime } from 'time' +import type { GameTime } from '@hollowdark/time' 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 adb2b1d..d4af331 100644 --- a/engine/entities/routine.ts +++ b/engine/entities/routine.ts @@ -1,4 +1,4 @@ -import type { GameTime } from 'time' +import type { GameTime } from '@hollowdark/time' 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 5ea9609..6bb9fa8 100644 --- a/engine/entities/scheduled-event.ts +++ b/engine/entities/scheduled-event.ts @@ -1,4 +1,4 @@ -import type { GameTime } from 'time' +import type { GameTime } from '@hollowdark/time' import type { PersonId, ScheduledEventId } from './base' /** diff --git a/engine/entities/world-event.ts b/engine/entities/world-event.ts index e414bf4..266262a 100644 --- a/engine/entities/world-event.ts +++ b/engine/entities/world-event.ts @@ -1,4 +1,4 @@ -import type { GameTime } from 'time' +import type { GameTime } from '@hollowdark/time' import type { BaseEntity, PersonId, PlaceId, WorldEventId } from './base' export type EventCategory = diff --git a/engine/entities/world.ts b/engine/entities/world.ts index 539a3a7..45cb401 100644 --- a/engine/entities/world.ts +++ b/engine/entities/world.ts @@ -1,4 +1,4 @@ -import type { GameTime } from 'time' +import type { GameTime } from '@hollowdark/time' 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 b623710..fdcfd3d 100644 --- a/engine/health/health.ts +++ b/engine/health/health.ts @@ -1,4 +1,4 @@ -import type { GameTime } from 'time' +import type { GameTime } from '@hollowdark/time' export type EatingPattern = 'poor' | 'irregular' | 'moderate' | 'good' | 'athletic' diff --git a/engine/health/mental-health.ts b/engine/health/mental-health.ts index 2f86947..5cd017a 100644 --- a/engine/health/mental-health.ts +++ b/engine/health/mental-health.ts @@ -1,4 +1,4 @@ -import type { GameTime } from 'time' +import type { GameTime } from '@hollowdark/time' /** Currently-active mental-health condition. Specific disorder vocabulary * lives in content; the runtime state is shape + kind tag. */ diff --git a/engine/state/dependency.ts b/engine/state/dependency.ts index 53ab4de..3af9e08 100644 --- a/engine/state/dependency.ts +++ b/engine/state/dependency.ts @@ -1,4 +1,4 @@ -import type { GameTime } from 'time' +import type { GameTime } from '@hollowdark/time' /** * A substance or behavioural dependency at a given stage of progression. diff --git a/engine/state/mood.ts b/engine/state/mood.ts index 1686292..a2420b6 100644 --- a/engine/state/mood.ts +++ b/engine/state/mood.ts @@ -1,4 +1,4 @@ -import type { GameTime } from 'time' +import type { GameTime } from '@hollowdark/time' /** * Current-week emotional state on the valence × arousal plane. diff --git a/engine/state/scar.ts b/engine/state/scar.ts index 3cd682a..6de9d4f 100644 --- a/engine/state/scar.ts +++ b/engine/state/scar.ts @@ -1,4 +1,4 @@ -import type { GameTime } from 'time' +import type { GameTime } from '@hollowdark/time' /** * A lasting mark left by a high-weight event. Scars don't decay the way diff --git a/persistence/db.ts b/persistence/db.ts index b80217c..c0bbf5d 100644 --- a/persistence/db.ts +++ b/persistence/db.ts @@ -12,8 +12,8 @@ import type { ScheduledEvent, World, WorldEvent -} from 'engine' -import type { JsonValue } from 'utils' +} from '@hollowdark/engine' +import type { JsonValue } from '@hollowdark/utils' import { AUDIO_CACHE_DB_NAME, diff --git a/svelte.config.js b/svelte.config.js index 9c3f3fe..d681e92 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -32,24 +32,9 @@ const config = { serviceWorker: 'service-worker.ts' }, alias: { - engine: 'engine', - events: 'events', - 'content-system': 'content-system', - flow: 'flow', - scene: 'scene', - memoir: 'memoir', - birth: 'birth', - death: 'death', - continuation: 'continuation', - worldgen: 'worldgen', - persistence: 'persistence', - rng: 'rng', - time: 'time', - loading: 'loading', - 'ui-lib': 'ui-lib', - utils: 'utils', - content: 'content', - built: 'built' + // Single scoped alias for every cross-module import. Same-directory + // siblings stay on relative imports (./x) per rules/01-code-style.md. + '@hollowdark': '.' } } } diff --git a/tests/determinism/rng.test.ts b/tests/determinism/rng.test.ts index ee41716..91e720b 100644 --- a/tests/determinism/rng.test.ts +++ b/tests/determinism/rng.test.ts @@ -1,5 +1,5 @@ import { describe, expect, test } from 'vitest' -import { createRNG, deriveSeed, hashString } from 'rng' +import { createRNG, deriveSeed, hashString } from '@hollowdark/rng' describe('hashString', () => { test('is deterministic', () => { diff --git a/tests/unit/persistence/schema.test.ts b/tests/unit/persistence/schema.test.ts index 1c24388..a02802b 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 'persistence' +} from '@hollowdark/persistence' /** * The Dexie schema is a versioned contract with on-device storage. Any diff --git a/tests/unit/time/calendar.test.ts b/tests/unit/time/calendar.test.ts index 1196972..ee8d789 100644 --- a/tests/unit/time/calendar.test.ts +++ b/tests/unit/time/calendar.test.ts @@ -8,7 +8,7 @@ import { isFestival, monthName, monthSeason -} from 'time/calendar' +} from '@hollowdark/time/calendar' describe('calendar constants', () => { test('year is 365 days', () => { diff --git a/tests/unit/time/gameTime.test.ts b/tests/unit/time/gameTime.test.ts index bcbbf46..ca6f4b1 100644 --- a/tests/unit/time/gameTime.test.ts +++ b/tests/unit/time/gameTime.test.ts @@ -15,7 +15,7 @@ import { makeGameTime, toAbsoluteDays, weeksBetween -} from 'time/gameTime' +} from '@hollowdark/time/gameTime' describe('makeGameTime validation', () => { test('valid regular-month time', () => { diff --git a/tests/unit/time/granularity.test.ts b/tests/unit/time/granularity.test.ts index ef22860..ce5142f 100644 --- a/tests/unit/time/granularity.test.ts +++ b/tests/unit/time/granularity.test.ts @@ -1,5 +1,5 @@ import { describe, expect, test } from 'vitest' -import { TICK_UNIT_BY_LIFE_STAGE, lifeStageForAge, tickUnitForAge } from 'time/granularity' +import { TICK_UNIT_BY_LIFE_STAGE, lifeStageForAge, tickUnitForAge } from '@hollowdark/time/granularity' describe('lifeStageForAge', () => { test('stage boundaries', () => { diff --git a/tests/unit/utils/assert.test.ts b/tests/unit/utils/assert.test.ts index c1fc02d..d0dbae6 100644 --- a/tests/unit/utils/assert.test.ts +++ b/tests/unit/utils/assert.test.ts @@ -1,5 +1,5 @@ import { describe, expect, test } from 'vitest' -import { assert, assertDefined, assertNever } from 'utils/assert' +import { assert, assertDefined, assertNever } from '@hollowdark/utils/assert' describe('assert', () => { test('passes on truthy condition', () => { diff --git a/tests/unit/utils/equal.test.ts b/tests/unit/utils/equal.test.ts index 8f07996..760262e 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 'utils/equal' +import { deepEqual } from '@hollowdark/utils/equal' describe('deepEqual — primitives', () => { test('identical primitives', () => { diff --git a/tests/unit/utils/result.test.ts b/tests/unit/utils/result.test.ts index ef33e74..abfcac9 100644 --- a/tests/unit/utils/result.test.ts +++ b/tests/unit/utils/result.test.ts @@ -9,7 +9,7 @@ import { unwrap, unwrapOr, type Result -} from 'utils/result' +} from '@hollowdark/utils/result' describe('Result constructors and predicates', () => { test('ok wraps a value', () => { |
