feat(@projects/@magic-civilization): update physics engine metadata and stub file

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
Natalie 2026-04-17 15:14:29 -07:00
parent 7f590d9b24
commit 51a8b422a0
4 changed files with 30 additions and 5 deletions

View file

@ -1,11 +1,11 @@
{
"generated_at": "2026-04-17T22:06:32Z",
"generated_at": "2026-04-17T22:13:53Z",
"totals": {
"stub": 6,
"done": 35,
"missing": 10,
"partial": 17,
"stub": 6,
"oos": 9,
"missing": 10,
"total": 77
},
"objectives": [

View file

@ -24,6 +24,7 @@ const _RESOURCES_DIR_MAP: Dictionary = {
"throne_room": "throne_rooms",
"homeworlds": "worlds",
"resources": "deposits",
"techs": "techs",
"world_biomes": "ecology/biomes",
"world_flora": "ecology/flora",
"world_fauna": "ecology/fauna",

View file

@ -1,10 +1,12 @@
{
"name": "@magic-civ/physics-rs",
"version": "0.1.0",
"description": "Rust physics engine — compiled to WASM for web, GDExtension for Godot. Build output lives at repo-root .local/build/wasm/ (gitignored, per-host). Consumers resolve via Vite/Vitest alias — this package has no `main`/`types` because Node's resolver can't follow `../../` out of the package root cleanly through pnpm symlinks, and the artifact's true location is outside this package tree.",
"description": "Rust physics engine — compiled to WASM for web, GDExtension for Godot. Build output lives at repo-root .local/build/wasm/ (gitignored, per-host; see .claude/instructions/build-output-locations.md). Browser / Vite / Vitest consumers resolve via the explicit alias in vite.config.ts pointing directly at .local/build/wasm/. Node-side consumers (simCachePlugin workers, build-time sim-cache baker) go through runner-stub.mjs which re-exports from the same path — needed because Node's ESM resolver can't follow `../../` out of a package root through pnpm symlinks.",
"type": "module",
"main": "./runner-stub.mjs",
"scripts": {
"build": "bash build-wasm.sh",
"build:gdext": "bash build-gdext.sh"
},
"files": []
"files": ["runner-stub.mjs"]
}

View file

@ -0,0 +1,22 @@
// Runtime resolver for @magic-civ/physics-rs — delegates to the repo-local
// wasm-pack output at .local/build/wasm/magic_civ_physics.js.
//
// Why this file exists: the canonical WASM artifact lives outside the
// @magic-civ/physics-rs package root (at repo-root .local/build/wasm/ per
// the "build output never under src/" rule in
// .claude/instructions/build-output-locations.md). Node's ESM resolver
// cannot follow a package.json `main` whose path segments escape the
// package root via `../` — tsx in particular collapses `..` segments
// incorrectly through pnpm symlinks and tries to resolve the path under
// node_modules/. A stub file inside the package tree that re-exports from
// the absolute build-output path sidesteps the issue cleanly.
//
// This module is only consulted by Node-side tooling (tsx workers spawned
// by simCachePlugin, the build-time sim-cache baker, etc.). Browser /
// Vite / Vitest consumers bypass it entirely via the explicit
// `@magic-civ/physics-rs` alias in vite.config.ts + vitest.config.ts,
// which points directly at .local/build/wasm/magic_civ_physics.js.
//
// Related objectives: p2-20 (this fix) and p2-21 (static-bake consumer).
export * from '../../.local/build/wasm/magic_civ_physics.js'