refactor: break circular deps in equipment and golems data modules
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m20s
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m20s
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
# Circular Dependencies
|
# Circular Dependencies
|
||||||
Generated: 2026-05-20T00:32:46.898Z
|
Generated: 2026-05-20T07:28:09.937Z
|
||||||
Found: 3 circular chain(s) — these MUST be fixed before modifying involved files.
|
Found: 3 circular chain(s) — these MUST be fixed before modifying involved files.
|
||||||
|
|
||||||
1. Processed 122 files (2.7s) (4 warnings)
|
1. Processed 125 files (1.3s) (4 warnings)
|
||||||
2. 1) data/equipment/index.ts > data/equipment/utils.ts
|
2. 1) data/equipment/index.ts > data/equipment/utils.ts
|
||||||
3. 2) data/golems/index.ts > data/golems/utils.ts
|
3. 2) data/golems/index.ts > data/golems/utils.ts
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"_meta": {
|
"_meta": {
|
||||||
"generated": "2026-05-20T00:32:43.891Z",
|
"generated": "2026-05-20T07:28:08.406Z",
|
||||||
"description": "Import dependency graph for src/lib/game. Keys are files, values are arrays of files they import.",
|
"description": "Import dependency graph for src/lib/game. Keys are files, values are arrays of files they import.",
|
||||||
"usage": "To find what a file affects, search for its path in the VALUES. To find what a file depends on, look at its KEY entry."
|
"usage": "To find what a file affects, search for its path in the VALUES. To find what a file depends on, look at its KEY entry."
|
||||||
},
|
},
|
||||||
@@ -358,6 +358,9 @@
|
|||||||
"data/golems/index.ts",
|
"data/golems/index.ts",
|
||||||
"data/golems/types.ts"
|
"data/golems/types.ts"
|
||||||
],
|
],
|
||||||
|
"data/guardian-encounters.ts": [
|
||||||
|
"types.ts"
|
||||||
|
],
|
||||||
"data/loot-drops.ts": [
|
"data/loot-drops.ts": [
|
||||||
"types.ts"
|
"types.ts"
|
||||||
],
|
],
|
||||||
@@ -572,6 +575,11 @@
|
|||||||
"utils/discipline-math.ts": [
|
"utils/discipline-math.ts": [
|
||||||
"types/disciplines.ts"
|
"types/disciplines.ts"
|
||||||
],
|
],
|
||||||
|
"utils/enemy-generator.ts": [
|
||||||
|
"types.ts",
|
||||||
|
"utils/enemy-utils.ts",
|
||||||
|
"utils/floor-utils.ts"
|
||||||
|
],
|
||||||
"utils/enemy-utils.ts": [
|
"utils/enemy-utils.ts": [
|
||||||
"constants.ts",
|
"constants.ts",
|
||||||
"types.ts",
|
"types.ts",
|
||||||
@@ -601,6 +609,13 @@
|
|||||||
"types.ts",
|
"types.ts",
|
||||||
"utils/enemy-utils.ts",
|
"utils/enemy-utils.ts",
|
||||||
"utils/floor-utils.ts"
|
"utils/floor-utils.ts"
|
||||||
|
],
|
||||||
|
"utils/spire-utils.ts": [
|
||||||
|
"constants.ts",
|
||||||
|
"data/guardian-encounters.ts",
|
||||||
|
"types.ts",
|
||||||
|
"utils/enemy-utils.ts",
|
||||||
|
"utils/floor-utils.ts"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -252,6 +252,7 @@ Mana-Loop/
|
|||||||
│ │ │ │ ├── body.ts
|
│ │ │ │ ├── body.ts
|
||||||
│ │ │ │ ├── casters.ts
|
│ │ │ │ ├── casters.ts
|
||||||
│ │ │ │ ├── catalysts.ts
|
│ │ │ │ ├── catalysts.ts
|
||||||
|
│ │ │ │ ├── equipment-types-data.ts
|
||||||
│ │ │ │ ├── feet.ts
|
│ │ │ │ ├── feet.ts
|
||||||
│ │ │ │ ├── hands.ts
|
│ │ │ │ ├── hands.ts
|
||||||
│ │ │ │ ├── head.ts
|
│ │ │ │ ├── head.ts
|
||||||
@@ -263,6 +264,7 @@ Mana-Loop/
|
|||||||
│ │ │ ├── golems/
|
│ │ │ ├── golems/
|
||||||
│ │ │ │ ├── base-golems.ts
|
│ │ │ │ ├── base-golems.ts
|
||||||
│ │ │ │ ├── elemental-golems.ts
|
│ │ │ │ ├── elemental-golems.ts
|
||||||
|
│ │ │ │ ├── golems-data.ts
|
||||||
│ │ │ │ ├── hybrid-golems.ts
|
│ │ │ │ ├── hybrid-golems.ts
|
||||||
│ │ │ │ ├── index.ts
|
│ │ │ │ ├── index.ts
|
||||||
│ │ │ │ ├── types.ts
|
│ │ │ │ ├── types.ts
|
||||||
@@ -352,6 +354,7 @@ Mana-Loop/
|
|||||||
├── package.json
|
├── package.json
|
||||||
├── playwright.config.ts
|
├── playwright.config.ts
|
||||||
├── postcss.config.mjs
|
├── postcss.config.mjs
|
||||||
|
├── scorecard.png
|
||||||
├── tailwind.config.ts
|
├── tailwind.config.ts
|
||||||
├── tsconfig.json
|
├── tsconfig.json
|
||||||
└── vitest.config.ts
|
└── vitest.config.ts
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 38 KiB |
@@ -0,0 +1,26 @@
|
|||||||
|
// ─── Equipment Types Data ───────────────────────────
|
||||||
|
// Combined equipment types from all category modules.
|
||||||
|
// Extracted to a standalone module to avoid circular dependencies
|
||||||
|
// between index.ts and utils.ts.
|
||||||
|
|
||||||
|
import { ACCESSORIES_EQUIPMENT } from './accessories';
|
||||||
|
import { BODY_EQUIPMENT } from './body';
|
||||||
|
import { CASTER_EQUIPMENT } from './casters';
|
||||||
|
import { CATALYST_EQUIPMENT } from './catalysts';
|
||||||
|
import { FEET_EQUIPMENT } from './feet';
|
||||||
|
import { HANDS_EQUIPMENT } from './hands';
|
||||||
|
import { HEAD_EQUIPMENT } from './head';
|
||||||
|
import { SHIELD_EQUIPMENT } from './shields';
|
||||||
|
import { SWORD_EQUIPMENT } from './swords';
|
||||||
|
|
||||||
|
export const EQUIPMENT_TYPES = {
|
||||||
|
...ACCESSORIES_EQUIPMENT,
|
||||||
|
...BODY_EQUIPMENT,
|
||||||
|
...CASTER_EQUIPMENT,
|
||||||
|
...CATALYST_EQUIPMENT,
|
||||||
|
...FEET_EQUIPMENT,
|
||||||
|
...HANDS_EQUIPMENT,
|
||||||
|
...HEAD_EQUIPMENT,
|
||||||
|
...SHIELD_EQUIPMENT,
|
||||||
|
...SWORD_EQUIPMENT,
|
||||||
|
};
|
||||||
@@ -2,40 +2,19 @@
|
|||||||
// Re-exports from all equipment type modules
|
// Re-exports from all equipment type modules
|
||||||
|
|
||||||
// Re-export types
|
// Re-export types
|
||||||
export type {
|
export type {
|
||||||
EquipmentSlot,
|
EquipmentSlot,
|
||||||
EquipmentCategory,
|
EquipmentCategory,
|
||||||
EquipmentType
|
EquipmentType
|
||||||
} from './types';
|
} from './types';
|
||||||
|
|
||||||
export {
|
export {
|
||||||
EQUIPMENT_SLOTS,
|
EQUIPMENT_SLOTS,
|
||||||
SLOT_NAMES
|
SLOT_NAMES
|
||||||
} from './types';
|
} from './types';
|
||||||
|
|
||||||
// Import all equipment type groups
|
// Re-export combined equipment types data (extracted to avoid circular deps)
|
||||||
import { ACCESSORIES_EQUIPMENT } from './accessories';
|
export { EQUIPMENT_TYPES } from './equipment-types-data';
|
||||||
import { BODY_EQUIPMENT } from './body';
|
|
||||||
import { CASTER_EQUIPMENT } from './casters';
|
|
||||||
import { CATALYST_EQUIPMENT } from './catalysts';
|
|
||||||
import { FEET_EQUIPMENT } from './feet';
|
|
||||||
import { HANDS_EQUIPMENT } from './hands';
|
|
||||||
import { HEAD_EQUIPMENT } from './head';
|
|
||||||
import { SHIELD_EQUIPMENT } from './shields';
|
|
||||||
import { SWORD_EQUIPMENT } from './swords';
|
|
||||||
|
|
||||||
// Combine all equipment types into EQUIPMENT_TYPES
|
|
||||||
export const EQUIPMENT_TYPES = {
|
|
||||||
...ACCESSORIES_EQUIPMENT,
|
|
||||||
...BODY_EQUIPMENT,
|
|
||||||
...CASTER_EQUIPMENT,
|
|
||||||
...CATALYST_EQUIPMENT,
|
|
||||||
...FEET_EQUIPMENT,
|
|
||||||
...HANDS_EQUIPMENT,
|
|
||||||
...HEAD_EQUIPMENT,
|
|
||||||
...SHIELD_EQUIPMENT,
|
|
||||||
...SWORD_EQUIPMENT,
|
|
||||||
};
|
|
||||||
|
|
||||||
// Re-export utility functions
|
// Re-export utility functions
|
||||||
export {
|
export {
|
||||||
@@ -47,3 +26,14 @@ export {
|
|||||||
getValidSlotsForEquipmentType,
|
getValidSlotsForEquipmentType,
|
||||||
canEquipInSlot,
|
canEquipInSlot,
|
||||||
} from './utils';
|
} from './utils';
|
||||||
|
|
||||||
|
// Re-export individual equipment groups for direct access
|
||||||
|
export { ACCESSORIES_EQUIPMENT } from './accessories';
|
||||||
|
export { BODY_EQUIPMENT } from './body';
|
||||||
|
export { CASTER_EQUIPMENT } from './casters';
|
||||||
|
export { CATALYST_EQUIPMENT } from './catalysts';
|
||||||
|
export { FEET_EQUIPMENT } from './feet';
|
||||||
|
export { HANDS_EQUIPMENT } from './hands';
|
||||||
|
export { HEAD_EQUIPMENT } from './head';
|
||||||
|
export { SHIELD_EQUIPMENT } from './shields';
|
||||||
|
export { SWORD_EQUIPMENT } from './swords';
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// ─── Equipment Helper Functions ─────────────────────────
|
// ─── Equipment Helper Functions ─────────────────────────
|
||||||
|
|
||||||
import type { EquipmentType, EquipmentSlot, EquipmentCategory } from './types';
|
import type { EquipmentType, EquipmentSlot, EquipmentCategory } from './types';
|
||||||
import { EQUIPMENT_TYPES } from './index';
|
import { EQUIPMENT_TYPES } from './equipment-types-data';
|
||||||
|
|
||||||
export function getEquipmentType(id: string): EquipmentType | undefined {
|
export function getEquipmentType(id: string): EquipmentType | undefined {
|
||||||
return EQUIPMENT_TYPES[id];
|
return EQUIPMENT_TYPES[id];
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
// ─── Golem Definitions Data ─────────────────────────
|
||||||
|
// Combined golem definitions from all golem modules.
|
||||||
|
// Extracted to a standalone module to avoid circular dependencies
|
||||||
|
// between index.ts and utils.ts.
|
||||||
|
|
||||||
|
import { BASE_GOLEMS } from './base-golems';
|
||||||
|
import { ELEMENTAL_GOLEMS } from './elemental-golems';
|
||||||
|
import { HYBRID_GOLEMS } from './hybrid-golems';
|
||||||
|
|
||||||
|
export const GOLEMS_DEF = {
|
||||||
|
...BASE_GOLEMS,
|
||||||
|
...ELEMENTAL_GOLEMS,
|
||||||
|
...HYBRID_GOLEMS,
|
||||||
|
};
|
||||||
@@ -4,17 +4,8 @@
|
|||||||
// Re-export types
|
// Re-export types
|
||||||
export type { GolemDef, GolemManaCost } from './types';
|
export type { GolemDef, GolemManaCost } from './types';
|
||||||
|
|
||||||
// Import all golem groups
|
// Re-export combined golems data (extracted to avoid circular deps)
|
||||||
import { BASE_GOLEMS } from './base-golems';
|
export { GOLEMS_DEF } from './golems-data';
|
||||||
import { ELEMENTAL_GOLEMS } from './elemental-golems';
|
|
||||||
import { HYBRID_GOLEMS } from './hybrid-golems';
|
|
||||||
|
|
||||||
// Combine all golems into GOLEMS_DEF
|
|
||||||
export const GOLEMS_DEF = {
|
|
||||||
...BASE_GOLEMS,
|
|
||||||
...ELEMENTAL_GOLEMS,
|
|
||||||
...HYBRID_GOLEMS,
|
|
||||||
};
|
|
||||||
|
|
||||||
// Re-export utility functions
|
// Re-export utility functions
|
||||||
export {
|
export {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// ─── Golem Helper Functions ─────────────────────────
|
// ─── Golem Helper Functions ─────────────────────────
|
||||||
|
|
||||||
import type { GolemDef, GolemManaCost } from './types';
|
import type { GolemDef, GolemManaCost } from './types';
|
||||||
import { GOLEMS_DEF } from './index';
|
import { GOLEMS_DEF } from './golems-data';
|
||||||
|
|
||||||
// Get golem slots based on Fabricator attunement level
|
// Get golem slots based on Fabricator attunement level
|
||||||
// Level 2 = 1, Level 4 = 2, Level 6 = 3, Level 8 = 4, Level 10 = 5
|
// Level 2 = 1, Level 4 = 2, Level 6 = 3, Level 8 = 4, Level 10 = 5
|
||||||
|
|||||||
Reference in New Issue
Block a user