feat: author first playable mystery

This commit is contained in:
2026-08-14 15:02:00 +02:00
parent d46a425401
commit b284275e98
13 changed files with 413 additions and 11 deletions
+3
View File
@@ -3,6 +3,7 @@ import path from 'node:path'
import { fileURLToPath } from 'node:url'
import pg from 'pg'
import type { CaseState } from '../src/types.js'
import { importMysteryTemplate } from '../scripts/importMysteryTemplate.js'
import { runMigrations } from './migrations.js'
const { Client } = pg
@@ -65,6 +66,8 @@ const saved = await fetch(`${baseUrl}/api/levels/${state.id}?edit=1`, {
})
if (!saved.ok) throw new Error(`Could not seed browser test level: ${saved.status}`)
await importMysteryTemplate(path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', 'mysteries', 'glass-harbor', 'mystery.json'), baseUrl)
let shuttingDown = false
async function shutdown(exitCode: number) {
if (shuttingDown) return