added realm to jspg processing

This commit is contained in:
2026-04-17 18:25:14 -04:00
parent 8ebf6a69bf
commit f450f8ab8b
59 changed files with 3884 additions and 2194 deletions

View File

@ -0,0 +1,43 @@
const fs = require('fs');
const path = require('path');
function updateFile(filePath) {
let content = fs.readFileSync(filePath, 'utf8');
let data;
try {
data = JSON.parse(content);
} catch (e) {
console.error("Failed to parse " + filePath, e);
return;
}
let changed = false;
for (let suite of data) {
if (suite.database && suite.database.schemas) {
if (!suite.database.puncs) suite.database.puncs = [];
for (let id of Object.keys(suite.database.schemas)) {
let schema = suite.database.schemas[id];
let puncType = {
name: id,
schemas: { [id]: schema }
};
suite.database.puncs.push(puncType);
}
delete suite.database.schemas;
changed = true;
}
}
if (changed) {
fs.writeFileSync(filePath, JSON.stringify(data, null, 2));
console.log("Updated " + filePath);
}
}
let fixturesDir = 'fixtures';
let files = fs.readdirSync(fixturesDir);
for (let file of files) {
if (file.endsWith('.json')) {
updateFile(path.join(fixturesDir, file));
}
}