Update class mechanics, stat rulesets, and CoA reference catalogs
This commit is contained in:
1 parent
b16821e92e
commit
39458d5de6
221 files changed
+2584962
-568
No files matched your search
@@ -0,0 +1,28 @@
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { gzipSync, gunzipSync } from "node:zlib";
|
||||
|
||||
export const julyBaselinePath = "data/coa-reference/baselines/coa-july-2026-07-25.json.gz";
|
||||
export const activeCatalogPath = "src/game/coaLiveData.generated.json";
|
||||
|
||||
export function resolveBaselinePath(projectRoot) {
|
||||
return fs.existsSync(path.join(projectRoot, julyBaselinePath)) ? julyBaselinePath : activeCatalogPath;
|
||||
}
|
||||
|
||||
export function decodeJsonBytes(bytes, filePath) {
|
||||
return filePath.endsWith(".gz") ? gunzipSync(bytes) : bytes;
|
||||
}
|
||||
|
||||
/** Preserve the original capture once; never replace it with a promoted catalog. */
|
||||
export function freezeJulyBaseline(projectRoot) {
|
||||
const destination = path.join(projectRoot, julyBaselinePath);
|
||||
if (fs.existsSync(destination)) return destination;
|
||||
const bytes = fs.readFileSync(path.join(projectRoot, activeCatalogPath));
|
||||
const capture = JSON.parse(bytes.toString("utf8"));
|
||||
if (capture.source?.synchronizedAt !== "2026-07-25T05:24:40.596Z") {
|
||||
throw new Error("Cannot freeze July baseline: active catalog is not the original July capture");
|
||||
}
|
||||
fs.mkdirSync(path.dirname(destination), { recursive: true });
|
||||
fs.writeFileSync(destination, gzipSync(bytes, { level: 9 }), { flag: "wx" });
|
||||
return destination;
|
||||
}
|
||||
Reference in new issue
Block a user