fix: add npcs.json and objs.json seed data with build validation - #98
fix: add npcs.json and objs.json seed data with build validation#98xusuxiang8 wants to merge 1 commit into
Conversation
| "remove-newbie-items:prod": "node dist/scripts/removeNewbieItemsFromHighLevelCharacters.js", | ||
| "reset-spell-stats": "tsx src/scripts/resetSpellStats.ts", | ||
| "reset-spell-stats:prod": "node dist/scripts/resetSpellStats.js", | ||
| "build": "pnpm run clean && tsc && echo --- Verifying JSON seed files --- && test -f src/jsons/balance.json && test -f src/jsons/craftingRecipes.json && test -f src/jsons/npcs.json && test -f src/jsons/objs.json && test -f src/jsons/smeltingRecipes.json && test -f src/jsons/spells.json && echo All JSON seed files present && mkdir -p dist/jsons dist/mapas_source && cp src/jsons/balance.json src/jsons/craftingRecipes.json src/jsons/npcs.json src/jsons/objs.json src/jsons/smeltingRecipes.json src/jsons/spells.json dist/jsons/ && cp -R src/mapas_source/. dist/mapas_source/", |
There was a problem hiding this comment.
💡 Quality: Build whitelist silently drops non-listed jsons/*.json files
The build was changed from cp src/jsons/*.json to an explicit list of 6 files, and each filename now appears twice (in the test -f guard and the cp argument). Any future or generated JSON seed file that is not added to both places will silently be excluded from dist/jsons/. Notably gameData.ts prefers objs.compact.json/npcs.compact.json when present via resolveSeedJsonPath; if those compact variants are ever generated into src/jsons, the old wildcard would have copied them but this new list will not, silently falling back to the full files. Consider keeping the wildcard copy (cp src/jsons/*.json dist/jsons/) for the copy step while retaining the explicit test -f checks only for the required files, so validation stays strict but no file is dropped.
Was this helpful? React with 👍 / 👎
Code Review 👍 Approved with suggestions 0 resolved / 1 findingsAdds npcs.json and objs.json seed data alongside strict build validation to prevent missing file failures. Consider adjusting the build whitelist to avoid silently dropping non-listed JSON files. 💡 Quality: Build whitelist silently drops non-listed jsons/*.json filesThe build was changed from 🤖 Prompt for agentsOptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |
Closes #83 and #84
Changes
Root Cause
Both issues (#83 market test, #84 wiki endpoint) failed because
the CI build was missing npcs.json in api/src/jsons/. The wildcard
cp src/jsons/*.json silently skipped missing files.
Verification