From 602c6410e1988557d687d9bac53a24c63f70f2d4 Mon Sep 17 00:00:00 2001 From: hided62 Date: Sat, 15 Aug 2026 07:08:03 +0000 Subject: [PATCH] refactor: finish internal export cleanup --- app/game-engine/src/turn/ai/generalAi/core.ts | 4 ++-- app/game-engine/src/turn/ai/generalAi/general/index.ts | 2 -- app/game-engine/src/turn/ai/generalAiGeneralActions.ts | 1 - app/game-engine/src/turn/ai/generalAiNationActions.ts | 1 - app/game-engine/test/helpers/turnTestHarness.ts | 4 ++-- app/game-engine/test/npcNationGrowthScenario.test.ts | 2 +- packages/logic/src/economy/index.ts | 1 - packages/logic/src/index.ts | 6 +++--- packages/logic/src/messages/index.ts | 1 - packages/logic/src/turn/index.ts | 1 - packages/logic/test/fixtures/minimalMap.ts | 2 +- tools/legacy-db-migration/src/currentSeason.ts | 4 ++-- 12 files changed, 11 insertions(+), 18 deletions(-) delete mode 100644 app/game-engine/src/turn/ai/generalAiGeneralActions.ts delete mode 100644 app/game-engine/src/turn/ai/generalAiNationActions.ts delete mode 100644 packages/logic/src/economy/index.ts delete mode 100644 packages/logic/src/messages/index.ts delete mode 100644 packages/logic/src/turn/index.ts diff --git a/app/game-engine/src/turn/ai/generalAi/core.ts b/app/game-engine/src/turn/ai/generalAi/core.ts index 0640725b..0c428251 100644 --- a/app/game-engine/src/turn/ai/generalAi/core.ts +++ b/app/game-engine/src/turn/ai/generalAi/core.ts @@ -31,8 +31,8 @@ import { withCanonicalArgumentAliases, } from '../aiUtils.js'; import { searchAllDistanceByNationList } from '@sammo-ts/logic/world/distance.js'; -import { generalActionHandlers } from '../generalAiGeneralActions.js'; -import { nationActionHandlers } from '../generalAiNationActions.js'; +import { generalActionHandlers } from './general/index.js'; +import { nationActionHandlers } from './nation/index.js'; import { resolveConstraintEnv, type ConstraintEnv } from './constraint.js'; import { buildSeedBase } from './seed.js'; import { WorldStateView } from './worldStateView.js'; diff --git a/app/game-engine/src/turn/ai/generalAi/general/index.ts b/app/game-engine/src/turn/ai/generalAi/general/index.ts index 55775514..ae8d47b1 100644 --- a/app/game-engine/src/turn/ai/generalAi/general/index.ts +++ b/app/game-engine/src/turn/ai/generalAi/general/index.ts @@ -7,8 +7,6 @@ import { do후방워프, do전방워프, do내정워프, do귀환, do집합 } fr import { doNPC헌납, doNPC사망대비 } from './npcActions.js'; import { do국가선택, do중립, do거병, do건국, do해산, do선양, do방랑군이동 } from './politicsActions.js'; -export { do징병 }; - export const generalActionHandlers: Record< string, (ai: GeneralAI) => ReturnType | null diff --git a/app/game-engine/src/turn/ai/generalAiGeneralActions.ts b/app/game-engine/src/turn/ai/generalAiGeneralActions.ts deleted file mode 100644 index e48b1812..00000000 --- a/app/game-engine/src/turn/ai/generalAiGeneralActions.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './generalAi/general/index.js'; diff --git a/app/game-engine/src/turn/ai/generalAiNationActions.ts b/app/game-engine/src/turn/ai/generalAiNationActions.ts deleted file mode 100644 index 7aa76a64..00000000 --- a/app/game-engine/src/turn/ai/generalAiNationActions.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './generalAi/nation/index.js'; diff --git a/app/game-engine/test/helpers/turnTestHarness.ts b/app/game-engine/test/helpers/turnTestHarness.ts index 313e76d2..d8f8b612 100644 --- a/app/game-engine/test/helpers/turnTestHarness.ts +++ b/app/game-engine/test/helpers/turnTestHarness.ts @@ -14,7 +14,7 @@ import { createNpcTaxHandler } from '../../src/turn/npcTaxHandler.js'; import { createFrontStateHandler } from '../../src/turn/frontStateHandler.js'; import { createNationTurnMonthlyHandler } from '../../src/turn/nationTurnMonthlyHandler.js'; -export const createMockPrisma = (initialGeneralRows: any[] = []) => { +const createMockPrisma = (initialGeneralRows: any[] = []) => { let generalRows = [...initialGeneralRows]; return { generalTurn: { @@ -47,7 +47,7 @@ export const createMockPrisma = (initialGeneralRows: any[] = []) => { }; }; -export const addMinutes = (time: Date, minutes: number): Date => new Date(time.getTime() + minutes * 60_000); +const addMinutes = (time: Date, minutes: number): Date => new Date(time.getTime() + minutes * 60_000); export type TurnHarnessRunOptions = { minutes?: number; diff --git a/app/game-engine/test/npcNationGrowthScenario.test.ts b/app/game-engine/test/npcNationGrowthScenario.test.ts index 47c69ab4..1997f828 100644 --- a/app/game-engine/test/npcNationGrowthScenario.test.ts +++ b/app/game-engine/test/npcNationGrowthScenario.test.ts @@ -12,7 +12,7 @@ import type { TurnGeneral, TurnWorldSnapshot, TurnWorldState } from '../src/turn import type { GeneralAiDebugState } from '../src/turn/ai/generalAi.js'; import type { InMemoryTurnWorld } from '../src/turn/inMemoryWorld.js'; import { GeneralAI } from '../src/turn/ai/generalAi.js'; -import { do징병 } from '../src/turn/ai/generalAiGeneralActions.js'; +import { do징병 } from '../src/turn/ai/generalAi/general/recruitActions.js'; import { buildCommandEnv, buildReservedTurnDefinitions } from '../src/turn/reservedTurnCommands.js'; import { LARGE_TEST_MAP, buildLargeTestCities } from './fixtures/largeTestMap.js'; import { round } from 'es-toolkit'; diff --git a/packages/logic/src/economy/index.ts b/packages/logic/src/economy/index.ts deleted file mode 100644 index a085cd12..00000000 --- a/packages/logic/src/economy/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './nationIncome.js'; diff --git a/packages/logic/src/index.ts b/packages/logic/src/index.ts index d8de2068..b1890679 100644 --- a/packages/logic/src/index.ts +++ b/packages/logic/src/index.ts @@ -7,9 +7,9 @@ export * from './auction/neutral.js'; export * from './constraints/index.js'; export * from './crewType/index.js'; export * from './diplomacy/index.js'; -export * from './economy/index.js'; +export * from './economy/nationIncome.js'; export * from './logging/index.js'; -export * from './messages/index.js'; +export * from './messages/message.js'; export * from './items/index.js'; export * from './rewards/uniqueLottery.js'; export * from './inheritance/inheritBuff.js'; @@ -19,7 +19,7 @@ export * from './ports/worldSnapshot.js'; export * from './ports/trace.js'; export * from './scenario/index.js'; export * from './triggers/index.js'; -export * from './turn/index.js'; +export * from './turn/calendar.js'; export * from './tournament/index.js'; export * from './troop/management.js'; export * from './world/index.js'; diff --git a/packages/logic/src/messages/index.ts b/packages/logic/src/messages/index.ts deleted file mode 100644 index 4b7e1649..00000000 --- a/packages/logic/src/messages/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './message.js'; diff --git a/packages/logic/src/turn/index.ts b/packages/logic/src/turn/index.ts deleted file mode 100644 index 7a9b0803..00000000 --- a/packages/logic/src/turn/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './calendar.js'; diff --git a/packages/logic/test/fixtures/minimalMap.ts b/packages/logic/test/fixtures/minimalMap.ts index 04df9de4..7b8bda43 100644 --- a/packages/logic/test/fixtures/minimalMap.ts +++ b/packages/logic/test/fixtures/minimalMap.ts @@ -1,6 +1,6 @@ import { type MapDefinition, type MapCityDefinition } from '../../src/world/types.js'; -export const MINIMAL_MAP_CITIES: MapCityDefinition[] = [ +const MINIMAL_MAP_CITIES: MapCityDefinition[] = [ { id: 1, name: '소성A', diff --git a/tools/legacy-db-migration/src/currentSeason.ts b/tools/legacy-db-migration/src/currentSeason.ts index b62953d0..043ed5e7 100644 --- a/tools/legacy-db-migration/src/currentSeason.ts +++ b/tools/legacy-db-migration/src/currentSeason.ts @@ -201,7 +201,7 @@ const migratePaged = async ( } }; -export const mapGeneral = (row: SourceRow, options: CurrentSeasonFixtureOptions): TargetRow => { +const mapGeneral = (row: SourceRow, options: CurrentSeasonFixtureOptions): TargetRow => { const id = toNumber(row.no, 'general.no'); const aux = jsonObjectOrLegacyEmpty(row.aux, `general.${id}.aux`); const meta: Record = { @@ -281,7 +281,7 @@ export const mapGeneral = (row: SourceRow, options: CurrentSeasonFixtureOptions) }; }; -export const mapNation = (row: SourceRow, nationEnv: Record): TargetRow => { +const mapNation = (row: SourceRow, nationEnv: Record): TargetRow => { const id = toNumber(row.nation, 'nation.nation'); const aux = jsonObject(row.aux, `nation.${id}.aux`); return {