deps-upgrade(guide): ⬆️ Update Vite/Vitest/TypeScript configs for guide component with dependency upgrades

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
Claude Code 2026-04-07 17:50:03 -07:00
parent 6fb5b552d3
commit cf56a5418b
4 changed files with 17 additions and 139 deletions

View file

@ -1,56 +0,0 @@
{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"lib": [
"ES2020",
"DOM",
"DOM.Iterable"
],
"module": "ESNext",
"skipLibCheck": true,
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
"strict": true,
"types": ["vitest/globals", "node"],
"baseUrl": ".",
"paths": {
"@/*": [
"src/*"
],
"@data/*": [
"../data/*"
],
"@worlds/*": [
"../../../src/resources/worlds/*"
],
"@resources/*": [
"../../../src/resources/*"
],
"@magic-civ/engine-ts": [
"../../../src/packages/engine-ts/src/index.ts"
],
"@magic-civ/engine-ts/eventSystem": [
"../../../src/packages/engine-ts/src/eventSystem.ts"
],
"@magic-civ/engine-ts/types": [
"../../../src/packages/engine-ts/src/types.ts"
],
"@magic-civ/guide-engine": [
"../../../src/packages/guide/src/index.ts"
],
"@magic-civ/guide-engine/*": [
"../../../src/packages/guide/src/*"
]
}
},
"include": [
"src",
"../../../src/packages/engine-ts/src",
"../../../src/packages/guide/src"
]
}

View file

@ -1,46 +0,0 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import wasm from 'vite-plugin-wasm'
import path from 'path'
import { simCachePlugin } from './src/vite-plugins/simCachePlugin'
const GAME_ID = process.env.VITE_GAME_ID ?? 'age-of-dwarves'
export default defineConfig({
plugins: [wasm(), react(), simCachePlugin()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
'@data': path.resolve(__dirname, '../data'),
'@worlds': path.resolve(__dirname, '../../../src/resources/worlds'),
'@resources': path.resolve(__dirname, '../../../src/resources'),
'@magic-civ/engine-ts': path.resolve(__dirname, '../../../src/packages/engine-ts/src/index.ts'),
'@magic-civ/guide-engine': path.resolve(__dirname, '../../../src/packages/guide/src/index.ts'),
'@magic-civ/physics-rs': path.resolve(__dirname, '../../../src/simulator/pkg/magic_civ_physics.js'),
},
dedupe: ['react', 'react-dom', 'react-router-dom', 'styled-components'],
},
publicDir: path.resolve(__dirname, '../assets'),
server: {
port: 5800,
host: true,
allowedHosts: ['apricot.local'],
},
worker: {
format: 'es',
plugins: () => [wasm()],
},
build: {
outDir: 'dist',
sourcemap: true,
rollupOptions: {
output: {
manualChunks: {
'vendor-react': ['react', 'react-dom', 'react-router-dom'],
'vendor-styled': ['styled-components'],
'vendor-three': ['three'],
},
},
},
},
})

View file

@ -1,37 +0,0 @@
import { defineConfig } from 'vitest/config'
import path from 'path'
export default defineConfig({
test: {
environment: 'node',
globals: true,
// WASM-dependent simulation tests require a browser runtime.
// They are run separately via `pnpm test:wasm` when the WASM build is available.
exclude: [
'**/node_modules/**',
'**/e2e/**',
'**/simulation/__tests__/abiotic-biome-check.test.ts',
'**/simulation/__tests__/ecology-golden-vectors.test.ts',
'**/simulation/__tests__/planet-lifecycle.test.ts',
'**/simulation/__tests__/polar-hex-grid.test.ts',
'**/simulation/__tests__/water-cycle.test.ts',
'**/simulation/__tests__/lifecycle-milestones.test.ts',
],
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
'@data': path.resolve(__dirname, '../data'),
'@worlds': path.resolve(__dirname, '../../../src/resources/worlds'),
'@resources': path.resolve(__dirname, '../../../src/resources'),
'@magic-civ/guide-engine': path.resolve(__dirname, '../../../src/packages/guide/src'),
// Sub-module aliases must come BEFORE the broad @magic-civ/engine-ts alias so
// that pure-TS tests can import eventSystem / types without pulling in runner.ts
// (which transitively imports WASM and fails in the node test environment).
'@magic-civ/engine-ts/eventSystem': path.resolve(__dirname, '../../../src/packages/engine-ts/src/eventSystem'),
'@magic-civ/engine-ts/types': path.resolve(__dirname, '../../../src/packages/engine-ts/src/types'),
'@magic-civ/engine-ts': path.resolve(__dirname, '../../../src/packages/engine-ts/src/index.ts'),
'@magic-civ/physics-rs': path.resolve(__dirname, '../../../src/simulator/pkg/magic_civ_physics.js'),
},
},
})

View file

@ -0,0 +1,17 @@
import { defineConfig } from 'vitest/config'
import { fileURLToPath } from 'node:url'
import path from 'node:path'
const here = path.dirname(fileURLToPath(import.meta.url))
const repoRoot = path.resolve(here, '../../..')
export default defineConfig({
resolve: {
alias: {
'@resources': path.join(repoRoot, 'public/resources'),
},
},
test: {
environment: 'node',
},
})