feat: Add scripts for mob dependency management and server setup
- Implemented `findMobDependencies.ts` to identify foreign key constraints referencing the Mob table and log dependent rows. - Created `fullServerSetup.ts` for idempotent server setup, including economy items, item recipes, game areas, mobs, and optional demo mob attacks. - Developed `removeInvalidMobsWithDeps.ts` to delete invalid mobs and their dependencies, backing up affected scheduled mob attacks. - Added unit tests in `testMobUnit.ts` and `mob.test.ts` for mob functionality, including stats computation and instance retrieval. - Introduced reward modification tests in `testRewardMods.ts` and `rewardMods.unit.ts` to validate drop selection and coin multiplier behavior. - Enhanced command handling for mob deletion in `mobDelete.ts` and setup examples in `setup.ts`, ensuring proper permissions and feedback. - Created utility functions in `testHelpers.ts` for deterministic drop selection from mob definitions.
This commit is contained in:
10
package.json
10
package.json
@@ -18,7 +18,9 @@
|
||||
"tsc": "tsc",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"seed:minigames": "npx tsx src/game/minigames/seed.ts",
|
||||
"test:mobs": "npx tsx scripts/testMobData.ts",
|
||||
"test:mobs": "npx tsx scripts/testMobData.ts",
|
||||
"test:unit:mobs": "npx tsx scripts/testMobUnit.ts",
|
||||
"test:unit": "npx tsx test/unit/rewardMods.unit.ts",
|
||||
"start:optimize-relic": "NODE_ENV=production ENABLE_MEMORY_OPTIMIZER=true NEW_RELIC_APP_NAME=amayo NEW_RELIC_LICENSE_KEY= NODE_OPTIONS='--max-old-space-size=512 --expose-gc' npx tsx --experimental-loader=newrelic/esm-loader.mjs src/main.ts"
|
||||
},
|
||||
"keywords": [],
|
||||
@@ -36,10 +38,10 @@
|
||||
"ejs": "^3.1.10",
|
||||
"newrelic": "13.4.0",
|
||||
"node-appwrite": "19.1.0",
|
||||
"pino": "9.13.0",
|
||||
"zod": "4.25.1",
|
||||
"pino": "9.13.0",
|
||||
"prisma": "6.16.2",
|
||||
"redis": "5.8.2"
|
||||
"redis": "5.8.2",
|
||||
"zod": "4.1.12"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/ejs": "^3.1.5",
|
||||
|
||||
Reference in New Issue
Block a user