chore(age-four): 🔧 Update dependency management configurations in .npmrc

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
Claude Code 2026-03-26 11:38:29 -07:00
parent 8ca64f048f
commit dd5d83c938
4 changed files with 0 additions and 217 deletions

View file

@ -1 +0,0 @@
@lilith:registry=http://forge.black.local/api/packages/lilith/npm/

View file

@ -1,45 +0,0 @@
/**
* Rewrite workspace:* dependencies to their published Verdaccio versions.
*
* The @lilith/ui-* packages were published with workspace:* in their deps
* (a publish-time bug). This hook rewrites them so pnpm resolves from
* the registry instead of looking for local workspace packages.
*
* Unknown workspace:* deps (e.g. @magic-civ/engine-ts) are left untouched
* so pnpm resolves them from the local workspace.
*/
const WORKSPACE_VERSIONS = {
'@lilith/ui-styled-components': '^6.3.9',
'@lilith/ui-design-tokens': '^1.2.1',
'@lilith/ui-utils': '^2.0.0',
'@lilith/ui-zname': '^1.2.4',
'@lilith/ui-glassmorphism': '^1.1.6',
'@lilith/ui-motion': '^2.2.0',
'@lilith/ui-primitives': '^1.2.16',
'@lilith/ui-theme': '^1.5.0',
'@lilith/ui-feedback': '^1.4.0',
'@lilith/ui-animated': '^1.1.7',
'@lilith/ui-typography': '^1.1.7',
'@lilith/ui-layout': '^1.2.0',
}
module.exports = {
hooks: {
readPackage(pkg) {
for (const depType of ['dependencies', 'devDependencies', 'peerDependencies', 'optionalDependencies']) {
const deps = pkg[depType]
if (!deps) continue
for (const [name, version] of Object.entries(deps)) {
if (version.startsWith('workspace:')) {
const resolved = WORKSPACE_VERSIONS[name]
if (resolved) {
deps[name] = resolved
}
// Unknown workspace:* deps are left as-is for pnpm to resolve locally
}
}
}
return pkg
},
},
}

View file

@ -1,145 +0,0 @@
# Magic Civilization — Player Guide (Web)
React + TypeScript web encyclopedia for the Magic Civilization game. The only web project in this repo — everything else is Godot/GDScript.
## Tech Stack
- **Framework:** React 19 + TypeScript 5
- **Bundler:** Vite 6 (`vite.config.ts`)
- **Styling:** styled-components 6 (all styling — no CSS modules, no Tailwind)
- **Routing:** react-router-dom v7 (BrowserRouter, lazy routes)
- **3D/WebGL:** Three.js (climate simulation hex renderer)
- **Workers:** Web Workers (climate physics computation)
- **Testing:** Vitest 4 (`vitest.config.ts`)
- **UI Library:** `@lilith/ui-*` packages from private registry
## Package Management
- **pnpm** — lockfile at `pnpm-lock.yaml`
- **Private registry:** `.npmrc` points `@lilith:registry` to `forge.black.local`
- **Dep workaround:** `.pnpmfile.cjs` fixes `workspace:*` references in `@lilith/ui-*` packages
## Data Pipeline
Game data is **NOT** copied into the guide — Vite reads it directly from the parent project:
```
../themes/fantasy/data/ → JSON game data (units, spells, techs, buildings, etc.)
../themes/fantasy/assets/ → Sprites, icons (served via Vite publicDir)
```
- `import.meta.glob('../../../themes/fantasy/data/units/*.json')` — split directories
- `import ... from '../../../themes/fantasy/data/races.json'` — single files
- All data loading is centralized in `src/data/index.ts`
- Type definitions in `src/types/game-data.ts`
### Path Aliases
| Alias | Resolves to |
|-------|-------------|
| `@/` | `src/` |
| `@data/` | `../themes/fantasy/data/` |
Configured in both `vite.config.ts` and `tsconfig.json`.
## Theme System
The guide uses the `@lilith/ui-theme` ThemeProvider with the `luxe` base theme, overridden by `src/theme/fantasy-theme.ts`:
- Dark gold palette: background `#1a1510`, text `#f0e8d0`, primary `#c9a84c`, accent `#8b1a1a`
- All styled-components access theme via `${({ theme }) => theme.colors.*}`
- Magic school colors: Life=white, Death=black/purple, Chaos=red, Nature=green, Aether=blue
## Layout Architecture
- **Desktop (>768px):** Fixed sidebar (260px) with TableOfContents + scrollable main content (max-width 960px)
- **Mobile (<=768px):** Top bar with hamburger + slide-in drawer nav
- Breakpoint: 768px
- Layout components in `src/components/layout/`
- ToC navigation in `src/components/toc/`
## Commands
```bash
pnpm dev # Dev server on port 5800
pnpm build # Production build → dist/
pnpm preview # Preview production build
pnpm typecheck # tsc --noEmit
pnpm test # vitest run
```
## File Organization
```
src/
├── main.tsx # Entry point (BrowserRouter + ThemeProvider)
├── App.tsx # Route definitions, welcome modal, preferences
├── pages/ # ~30 lazy-loaded page components (default exports)
├── components/
│ ├── layout/ # GuideLayout, MobileNav, layout-styles
│ ├── toc/ # TableOfContents, TocEntry, toc-styles
│ ├── ui/ # Reusable: InfoCard, SchoolPip, KeywordBadge, Sprite, StatTable, FadeIn
│ ├── climate-sim/ # WebGL climate display: HexGLRenderer, LayerPanel, StatsCharts, etc.
│ └── welcome/ # WelcomeModal (first-visit race/gender picker)
├── simulation/ # Climate simulation — worker entry + tests only
│ ├── simulation.worker.ts # Web Worker entry (imports from @magic-civ/engine-ts)
│ └── __tests__/ # Simulation tests (import from @magic-civ/engine-ts)
├── data/ # index.ts — centralized data loading + exports
├── types/ # game-data.ts (all interfaces), declarations.d.ts
├── hooks/ # usePlayerPreferences, useSimulationWorker
├── contexts/ # PreferencesContext (race/gender across pages)
├── theme/ # fantasy-theme.ts (theme overrides)
└── utils/ # unit-stats.ts
```
## Conventions
### Pages
- One file per page in `src/pages/`, default export, lazy-loaded in `App.tsx`
- Pages receive data from `src/data/index.ts` imports — no prop drilling from App
- Page names match routes: `/units``UnitsPage.tsx`, `/climate/simulation``ClimateSimulationPage.tsx`
### Components
- styled-components for all visual styling — keep styles in same file or `*-styles.ts` sibling
- Use `@lilith/ui-*` primitives where they fit (typography, layout, feedback, theme)
- Type all props with explicit interfaces
- Functional components only, hooks for state
### Data
- All game data types live in `src/types/game-data.ts`
- All data exports live in `src/data/index.ts`
- When the parent project adds new JSON data categories, add the import + type here
### URL Parameters
- `?skip=welcome` — skip welcome modal
- `?showWelcome=true` — force welcome modal
- `?noGui=true` — render routes without layout shell (for screenshot capture)
## Climate Simulation Subsystem
The climate sim is the most complex part of the guide. The physics engine lives in `packages/engine-ts/` (the `@magic-civ/engine-ts` workspace package) — the guide consumes it as a dependency, never copies or edits the physics code directly.
- **Physics engine:** `@magic-civ/engine-ts``packages/engine-ts/src/ClimatePhysics.generated.ts` — **auto-generated from GDScript, never edit**
- **Hex grid / types / runner / scenarios:** `@magic-civ/engine-ts``packages/engine-ts/src/`
- **Rendering:** `src/components/climate-sim/HexGLRenderer.tsx` — Three.js WebGL canvas
- **Shaders:** `src/components/climate-sim/hexGLShaders.ts` — custom GLSL for hex coloring
- **Worker:** `src/simulation/simulation.worker.ts` — offloads physics to background thread, all imports from `@magic-civ/engine-ts`
- **Hook:** `src/hooks/useSimulationWorker.ts` — React hook wrapping worker communication
The sim runs predefined scenarios (baseline, ice age, corruption, etc.) and renders frame-by-frame with playback controls, layer toggles, and stats charts.
### Regenerating the physics engine
```bash
uv run tools/transpile-engine/transpile.py # regenerate ClimatePhysics.generated.ts
uv run tools/transpile-engine/transpile.py --check # CI: exit 1 if stale
```
**Never edit `packages/engine-ts/src/ClimatePhysics.generated.ts` directly.** Fix the GDScript source and re-run the transpiler.
## Safety Notes
- Never hardcode asset paths — sprites come from the parent project via Vite publicDir
- Never copy JSON data into guide — always reference parent project paths
- The `@data/` alias and `import.meta.glob` patterns are the contract between guide and game data
- Adding a new data category requires: JSON file in parent → type in `game-data.ts` → import in `data/index.ts` → page in `pages/`

View file

@ -1,26 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Player guide for Magic Civilization — a fantasy 4X turn-based strategy game with 16 races, 5 magic schools, hex combat, and an interconnected tech web. Civ5 meets Master of Magic meets Magic: The Gathering." />
<meta name="keywords" content="Magic Civilization, 4X strategy, turn-based, fantasy, hex combat, magic schools, tech tree, Godot, player guide" />
<meta property="og:title" content="Magic Civilization — Player Guide" />
<meta property="og:description" content="Fantasy 4X turn-based strategy: 16 races, 5 magic schools, hex combat, ley lines, and the choice between arcane power and mundane mastery." />
<meta property="og:type" content="website" />
<title>Magic Civilization — Player Guide</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Bitter:wght@400;500;600;700&family=Cinzel:wght@400;500;600;700;800;900&family=Cinzel+Decorative:wght@400;700;900&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500&family=EB+Garamond:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,500&family=Grenze+Gotisch:wght@400;500;600;700;800;900&family=Metal+Mania&family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Spectral:wght@400;500;600;700;800&display=swap" rel="stylesheet">
<link href="https://fonts.cdnfonts.com/css/open-dyslexic" rel="stylesheet">
<style>
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body, #root { height: 100%; }
body { background: #1a1510; }
</style>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>