diff --git a/.planning/phases/01-level-up-pf2e-regelkonform/SEED-README.md b/.planning/phases/01-level-up-pf2e-regelkonform/SEED-README.md index 24ed405..f628dda 100644 --- a/.planning/phases/01-level-up-pf2e-regelkonform/SEED-README.md +++ b/.planning/phases/01-level-up-pf2e-regelkonform/SEED-README.md @@ -35,9 +35,16 @@ npm run db:seed:class-progression Idempotent: running twice does not duplicate rows. Console output reports `created` and `updated` counts plus any errors. +## Foundry pf2e v8 layout note + +In Foundry pf2e v8 (the pinned tag `pf2e-8.0.3`), class JSONs live under +`packs/pf2e/classes/`. Earlier major versions (v7) used `packs/classes/` directly. The +seed script reads from the v8 path; if you bump the pinned tag back to a v7 release, +update `FOUNDRY_CLASSES_DIR` in `server/prisma/seed-class-progression.ts` accordingly. + ## Failure modes -- **"Foundry pf2e clone not found at server/prisma/data/foundry-pf2e/packs/classes/"** — +- **"Foundry pf2e clone not found at server/prisma/data/foundry-pf2e/packs/pf2e/classes/"** — run the `git clone` step above. - **"Class JSON does not match expected schema"** — Foundry pf2e changed the JSON shape between major versions. Update the seed parser or pin to an older tag. diff --git a/server/prisma/seed-class-progression.ts b/server/prisma/seed-class-progression.ts index da29fab..8652c70 100644 --- a/server/prisma/seed-class-progression.ts +++ b/server/prisma/seed-class-progression.ts @@ -28,7 +28,17 @@ import { CLASS_FEATURE_OPTIONS } from './data/class-feature-options'; const adapter = new PrismaPg({ connectionString: process.env.DATABASE_URL }); const prisma = new PrismaClient({ adapter }); -const FOUNDRY_CLASSES_DIR = path.join(__dirname, 'data', 'foundry-pf2e', 'packs', 'classes'); +// Foundry pf2e v8 nests packs under a system subdirectory: `packs/pf2e/classes/`. +// (RESEARCH §Pitfall 5: Foundry pf2e data shape may shift across major versions. +// In v7 this was `packs/classes/`. SEED-README pins us to pf2e-8.0.3.) +const FOUNDRY_CLASSES_DIR = path.join( + __dirname, + 'data', + 'foundry-pf2e', + 'packs', + 'pf2e', + 'classes', +); // The 16 D-16 classes. Filename in Foundry = lowercase classname. const D16_CLASS_NAMES = [