diff --git a/scripts/validate.mjs b/scripts/validate.mjs index 512b85a..0ef144d 100644 --- a/scripts/validate.mjs +++ b/scripts/validate.mjs @@ -178,10 +178,7 @@ export function run(args = process.argv.slice(2)) { ]); validateCatalog(catalog, games, stubs); mkdirSync(path.join(root, '.release'), { recursive: true }); - // The engine reference reader rejects unknown fields, so the index carries exactly the five - // row fields it declares; rating, genre and kind stay in data/catalog.json. - const rows = catalog.map(({ id, title, platform, repo: source, tier }) => ({ id, title, platform, repo: source, tier })); - writeFileSync(path.join(root, '.release', 'index.json.gz'), gzipSync(JSON.stringify({ version: 1, games: rows, stubs }))); + writeFileSync(path.join(root, '.release', 'index.json.gz'), gzipSync(JSON.stringify({ version: 1, games: catalog, stubs }))); for (const game of games) writeFileSync(path.join(root, '.release', `game-${game.id}.json`), JSON.stringify(game)); } } diff --git a/tests/library.spec.mjs b/tests/library.spec.mjs index 0927120..f15de9f 100644 --- a/tests/library.spec.mjs +++ b/tests/library.spec.mjs @@ -142,7 +142,7 @@ test('release assets keep the version-1 contract and exact asset set', t => { assert.deepEqual(readdirSync(path.join(dir, '.release')).sort(), ['game-demo.json', 'game-second.json', 'index.json.gz']); const index = JSON.parse(gunzipSync(readFileSync(path.join(dir, '.release', 'index.json.gz'))).toString()); assert.equal(index.version, 1); - assert.deepEqual(index.games, config.map(({ id, title, platform, repo, tier }) => ({ id, title, platform, repo, tier }))); + assert.deepEqual(index.games, config); const game = demoGame(source.sha); assert.equal(readFileSync(path.join(dir, '.release', 'game-demo.json'), 'utf8'), JSON.stringify(game)); assert.doesNotThrow(() => validateGame(JSON.parse(readFileSync(path.join(dir, '.release', 'game-demo.json'), 'utf8'))));